Useful commands for daily use

“Under Linux there are graphical user interfaces (GUIs), where you can point and click and drag, and hopefully get work done terminalwithout first reading lots of documentation. The traditional Unix environment is a CLI (command line interface), where you type commands to tell the computer what to do. That is faster and more powerful, but requires finding out what the commands are.” -man intro

Find in this post a list of some useful commands for this week.

– Download a file and uncompress it while it downloads

$wget http://URL/FILE.tar.gz -O - | tar xfz -

– If you play loto, try this command to generate the 6 numbers :

$echo $(shuf -n 6 -i 1-49 | sort -n)

– To get the CPU temperature continuously on the desktop

$while :; do acpi -t | osd_cat -p bottom ; sleep 1; done &

– Search for large files and show size and location.


$find . -size +100000k -exec du -h {} ;

– Get a random Command

$ls /usr/bin | shuf -n 1

This is useful if you want to explore various random commands.

More commands :

– Bash logger :Log everything from a bash script to a file

$script /tmp/log.txt

– Using NMAP to check if a port is open or close

$nmap -oG - -T4 -p22 -v 192.168.0.254 | grep ssh

– Get the IP of the host your coming from when logged in remotely

$echo ${SSH_CLIENT%% *}

 

If you know more commads please share them by commenting this post. Thanks.

{module user9-footer}

Useful Links: commandlinefu.com