Some more very useful Linux commands.

Posted: November 4, 2017. At: 12:07 PM. This was 2 weeks ago. Post ID: 11510
Page permalink: http://securitronlinux.com/debian-testing/some-more-very-useful-linux-commands/

This Linux command will print all the filenames of the PAM libraries in the /lib directory. A good use of the find command.

find /lib{,64} -iname '*pam*.so'

Print a waveform in the terminal that will continue until you press control-c.

for((i=0;;i++)) {
	printf "%$(bc -l <<< "a=20*s($i/10);scale=0;a/1+20")s|\n"; sleep .05;
}

Get information about your Linux system the easy way.

ubuntu ~ $ inxi -F
System:    Host: ip-172-31-20-16 Kernel: 3.13.0-63-generic x86_64 (64 bit) Console: tty 0 Distro: Ubuntu 14.04 trusty
Machine:   System: Xen product: HVM domU version: 4.2.amazon
           Mobo: N/A model: N/A Bios: Xen version: 4.2.amazon date: 03/31/2016
CPU:       Single core Intel Xeon CPU E5-2676 v3 (-MCP-) cache: 30720 KB flags: (lm nx sse sse2 sse3 sse4_1 sse4_2 ssse3) clocked at 2394.498 MHz
Graphics:  Card: Cirrus Logic GD 5446 X-Vendor: N/A driver: N/A tty size: 124x43 Advanced Data: N/A out of X
Network:   Card: Failed to Detect Network Card!
Drives:    HDD Total Size: 32.2GB (92.2% used) 1: id: /dev/xvda model: N/A size: 32.2GB
Partition: ID: / size: 30G used: 28G (99%) fs: ext4
RAID:      No RAID devices detected - /proc/mdstat and md_mod kernel raid module present
Sensors:   None detected - is lm-sensors installed and configured?
Info:      Processes: 124 Uptime: 542 days  0:32 Memory: 300.2/992.5MB Runlevel: 2 Client: Shell (bash) inxi: 1.9.17

This is a very cool trick. It starts a process detached from your shell/terminal, wont pollute your terminal with any output and wont die if you close the terminal / shell. Put this into your .bashrc file.

disown() {
    ( "[email protected]" & disown -h ) &>/dev/null
}

Run it like this.

disown wget https://cdn.kernel.org/pub/linux/kernel/v4.x/linux-4.13.11.tar.xz

Even if the terminal is closed, it will still run.

Just like this trick.

nohup wget https://cdn.kernel.org/pub/linux/kernel/v4.x/linux-4.13.11.tar.xz &

That will also keep on running even if the terminal is closed.

Convert text from uppercase to lower case.

echo "HELLO WORLD, THIS IS YOUR LEADER SPEAKING" | tr "[:upper:]" "[:lower:]"
hello world, this is your leader speaking

No comments have been made. Use this form to start the conversation :)

Leave a Reply