Useful Linux Commands - Part 10

The following are a list of commonly used Linux Administration Commands.

Linux Printing commands

Linux Command Description
lp file Print file
lpq Display print queue
lpstat -d Display default printer
lpr -P printer filename Print using lpr command. Print filename to specified printer printer
lpoptions -d default_printer Set default printer default_printer
lp -n no_of_copies filename Print filename no_of_copies times
lprm job_id Delete/Cancel print job. Job id is normally displayed after print command.

Shutdown Commands

Linux Command Description
telinit Switch runlevel
init Switch runlevel
reboot Reboots system when run by root user
shutdown -r Reboot system
shutdown -h now Shutdown Immediately
shutdown -c Cancels shutdown
shutdown -k Send out Shutdown message, disable logins, however Does not shutdown system

Miscellaneous Commands

Linux Command Description
history Display commands entered
!number Repeat command displayed from history command
diff file1 file2 Display difference between file1> file2
dd if=/dev/zero of=test.dat bs=1024 count=10240 Create a 10MB file using dd command
dd if=/dev/zero of=test.dat bs=1M count=10 Create a 10MB file (Easy to understand version)
cal Display calendar for current month
cal -m number of month Displays calendar for specified number of month
date Displays Today's date and time
fallocate -l 3G file.img Create a file of specified size with the specified name
watch command Execute a program periodically
column Formats input into multiple columns