LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 05-20-2019, 03:51 AM   #76
Lucio Chiappetti
LQ Newbie
 
Registered: Dec 2014
Posts: 15

Rep: Reputation: Disabled

If by terminal you mean terminal emulator like xterm or urxvt, the most useful is an "identframe" script which annotates thew window banner with hostname, username and tty numbere. This is invoked by .cshrc on all our machines (so when one ssh's there, one knows where one is, and is "invoked back" exiting by aliases like ssh !* ; identframe). I attach the version I am using (with escape sequences for a lot of old obsoleted terminals).

Otherwise I have plenty of aliases in my .cshrc.
Attached Files
File Type: txt identframe.txt (2.3 KB, 7 views)
 
Old 05-20-2019, 07:31 PM   #77
mastemmer
Member
 
Registered: Jul 2007
Location: Porto Alegre, Brazil
Distribution: Slackware
Posts: 40

Rep: Reputation: 17
Search a searchdir looking for files that have a substring in their name
du -a searchdir | grep substring
 
Old 05-20-2019, 07:37 PM   #78
slow_footed_Buffalo
LQ Newbie
 
Registered: Feb 2011
Distribution: had fedora 14
Posts: 15

Rep: Reputation: 0
for the common idiot spect is great sorry if you dont know what Im talking about. probably WP devs
 
Old 05-21-2019, 07:56 AM   #79
kysh
LQ Newbie
 
Registered: Apr 2019
Posts: 1

Rep: Reputation: Disabled
watch du -sh "'Directory when doing space intensive file operations'"
 
Old 05-23-2019, 04:55 AM   #80
rhamel
Member
 
Registered: Sep 2009
Location: Caribbean
Distribution: Slackware 14.2
Posts: 59

Rep: Reputation: Disabled
Over the years, I have tried several ways to find more space on filesystems which, just inevitably, seem to fill up over time.

It was always a pain until I discovered ncdu. This is a little utility which does one thing and does it well.

ncdu sorts files & directories by size, biggest first.

It then allows you to delete the file/folder using a simple highlight bar and pressing the letter 'd'. You then get a confirmation dialog (in case you pressed 'd' accidentally).

There is the ability to invoke a shell if you need to examine the contents of the file first.

This utility, ncdu has become my absolute must-have command for managing filesystem space.

As the saying goes, "Never leave home without it!"
 
3 members found this post helpful.
Old 05-23-2019, 10:54 AM   #81
rhamel
Member
 
Registered: Sep 2009
Location: Caribbean
Distribution: Slackware 14.2
Posts: 59

Rep: Reputation: Disabled
Over the years, I have tried several ways to find more space on filesystems which, just inevitably, seem to fill up over time.

It was always a pain until I discovered ncdu. This is a little utility which does one thing and does it well.

ncdu sorts files & directories by size, biggest first.

It then allows you to delete the file/folder using a simple highlight bar and pressing the letter 'd'. You then get a confirmation dialog (in case you pressed 'd' accidentally).

There is the ability to invoke a shell if you need to examine the contents of the file first.

This utility, ncdu has become my absolute must-have command for managing filesystem space.

As the saying goes, "Never leave home without it!"
 
Old 05-24-2019, 10:33 AM   #82
Contrapak
Member
 
Registered: May 2019
Location: /home/
Distribution: Arch Linux
Posts: 107

Rep: Reputation: 12
Quote:
Originally Posted by rhamel View Post
Over the years, I have tried several ways to find more space on filesystems which, just inevitably, seem to fill up over time.

It was always a pain until I discovered ncdu. This is a little utility which does one thing and does it well.

ncdu sorts files & directories by size, biggest first.

It then allows you to delete the file/folder using a simple highlight bar and pressing the letter 'd'. You then get a confirmation dialog (in case you pressed 'd' accidentally).

There is the ability to invoke a shell if you need to examine the contents of the file first.

This utility, ncdu has become my absolute must-have command for managing filesystem space.

As the saying goes, "Never leave home without it!"
This is great. Thank you!
 
Old 05-25-2019, 01:13 AM   #83
josephj
Member
 
Registered: Nov 2007
Location: Northeastern USA
Distribution: kubuntu
Posts: 184

Rep: Reputation: 99
It took me forever to start using Alt+. which inserts the last argument of the previous command, but now I use it all the time.
 
Old 05-25-2019, 03:17 AM   #84
proMusic
LQ Newbie
 
Registered: May 2019
Posts: 20

Rep: Reputation: Disabled
Code:
poweroff
Just Kidding!

Code:
alias h='history|grep'
^ I frequently find this alias useful for searching my history.

Code:
man manpage | col -b -x > somefile
^ Turn a manpage into a text file, which I use as part of a script to grep keywords in my manpages.

Last edited by proMusic; 05-25-2019 at 04:06 AM.
 
Old 05-25-2019, 05:26 AM   #85
bodiccea
LQ Newbie
 
Registered: May 2019
Posts: 4

Rep: Reputation: Disabled
REISUB

The following is not a terminal trick, but rather a system/keyboard one.

REISUB. Remember this word, it could save you when your system becomes really unstable/unresponsive, and your only solution is the power-off button.

First, the following will not work if the system is not configured properly: You need to to have the "magic system request key" enabled (more details on https://www.kernel.org/doc/html/late...ide/sysrq.html):

This means you need to add the following line to your /etc/sysctl.conf:
Code:
kernel.sysrq=244
You will need to to reboot to have this effective (or you may avoid a reboot by enabling it with (as root): echo 244 > /proc/sys/kernel/sysrq).

Then, the magic can operate: In case of fatal system issues that you cannot solve another way, instead of a brutal power-off, just hold the <alt> and <sysrq> keys, then, in sequence, press the 'R', 'E', 'I', 'S', 'U', and 'B' keys.

The actions will be the following:
  • R: switch keyboard to XLATE (ASCII) mode.
  • E: send SIGTERM signal to all processes (except init). Should allow (well written) processes to exit a clean way (save files, etc...)
  • I: send SIGKILL signal to all processes (except init). Data not saved in previous step will be lost
  • S: write all caches data to disk (will reduce risk of data corruption)
  • U: remount all mounted filesystems read-only
  • B: reboot

You should wait between each key, to give the system enough time to execute the operations.
 
1 members found this post helpful.
Old 05-25-2019, 06:44 AM   #86
teckk
Senior Member
 
Registered: Oct 2004
Distribution: FreeBSD Arch
Posts: 2,129

Rep: Reputation: 407Reputation: 407Reputation: 407Reputation: 407Reputation: 407
A few examples of man page to different format.
Code:
man -t ls | ps2pdf - output.pdf
man ls | roff2pdf > output.pdf

man -P cat ls > output.txt
man ls | roff2text > output.txt
man ls | col -b > output.txt
man -t ls | ps2ascii - output.txt

man ls | roff2html > output.html
man ls | groff -mandoc -Thtml > output.html
 
Old 05-25-2019, 07:43 AM   #87
teckk
Senior Member
 
Registered: Oct 2004
Distribution: FreeBSD Arch
Posts: 2,129

Rep: Reputation: 407Reputation: 407Reputation: 407Reputation: 407Reputation: 407
List all commands present on system by folder.
Code:
ls ${PATH//:/ }
And of course you can redirect that to file
Code:
ls ${PATH//:/ } > com.txt
Another one
Code:
apropos --sections 1,8 -w '*' | less
 
7 members found this post helpful.
Old 05-25-2019, 07:47 AM   #88
hydrurga
LQ Guru
 
Registered: Nov 2008
Location: Pictland
Distribution: Linux Mint 19.1 MATE
Posts: 8,007
Blog Entries: 5

Rep: Reputation: 2854Reputation: 2854Reputation: 2854Reputation: 2854Reputation: 2854Reputation: 2854Reputation: 2854Reputation: 2854Reputation: 2854Reputation: 2854Reputation: 2854
Quote:
Originally Posted by teckk View Post
List all commands present on system by folder.
Code:
ls ${PATH//:/ }
Sweet.
 
1 members found this post helpful.
Old 05-25-2019, 10:02 AM   #89
individual
Member
 
Registered: Jul 2018
Posts: 164

Rep: Reputation: 125Reputation: 125
Quote:
Originally Posted by mastemmer View Post
Search a searchdir looking for files that have a substring in their name
du -a searchdir | grep substring
find dir -name '*substring*' might be more appropriate for this use case.
 
Old 05-25-2019, 11:41 AM   #90
average_user
Member
 
Registered: Dec 2010
Location: Warsaw, Poland
Distribution: Slackware
Posts: 365

Rep: Reputation: 138Reputation: 138
Quote:
Originally Posted by teckk View Post
List all commands present on system by folder.
Code:
ls ${PATH//:/ }
In Bash you can achieve something similar with `compgen -c` but it will just list all possible commands without directories names.

Last edited by average_user; 05-25-2019 at 12:39 PM.
 
1 members found this post helpful.
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: What is your favorite Linux terminal trick? LXer Syndicated Linux News 0 08-01-2018 12:41 PM
Poll: (Without the poll) - How is Linux used in your workplace? SlowCoder General 13 09-11-2007 11:03 PM
vim :gui trick and undo-trick dazdaz Linux - Software 3 09-10-2007 02:45 PM
Poll: What is your favorite brand of Motherboard? dstrbd1 Linux - Hardware 2 02-16-2006 05:40 PM
Weekly Hardware Poll, Dec 14th: What's your favorite notebook? finegan Linux - Hardware 18 12-03-2004 12:31 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 12:28 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration