Day-to-Day useful Linux commands


Pinoy Techie
Displays ipaddress from /etc/hosts file
#hostname -i

Displays domain name from /etc/hosts file
#hostname -d

Command to find folder size
#du -sh

Used to determine wireless is enabled or not&configure a wireless network interface

Command used to bring up the eth0 interface down
#ifconfig eth0 down

Command used to bring up the eth0 interface up
#ifconfig eth0 up

Command used to print sequence of number from 1 – 25
#seq 1 25

Inform the OS of partition table changes

Command to Open pdf file from Command Mode
#acroread Desktop/Books/Bash-Beginners-Guide.pdf &

Command used to open Web Page from Command mode

Command used to get in to tutorial in VIM editor

Command used to find Spelling mistake in a file
#aspell list < newfile

Command used to change between Virtual terminal
#chvt 1

Command used to view a file content in reverse order

Command used to display an image from command mode
#display test.png

Command to convert pdf to any format
#convert bash.pdf pash.jpg

Redirecting Output to another pesto terminal
#cal > /dev/tty3

Delete the first line from the file file.txt
#sed -i 1d file.txt

Delete the fifth and Sixth line of file file.txt
#sed -i 5,6d file.txt

Way to empty a file
#cat /dev/null > test.txt

Way to empty a file
#echo > test.txt

Command to find out how many lines, word and letters in the file
#wc Rajkumar.sh23 ( man wc -> for more wc options)

command to redirect man page output to a txt file
#man set | col -b > bultincommands.txt(or)#man set > set.txt

command to change man page to pdf file
#man -t sendmail | ps2pdf – sendmail.pdf

command to add user
# useradd

For password
# passwd

Command to show present working directory
# pwd

Finding a File Containing a Particular Text String in given directory
find /var/www/ -type f -exec grep -i 'TEXT' '{}' \; -print

Similar threads

Top Bottom