USEFUL LINUX COMMANDS

USEFUL Linux commands

Useful and basic linux commands

Many people find Linux difficult but this is wrong. Linux is a very simple Operating system . In this post, we will learn some simple commands of Linux.

Which will help system administrators and students.

Useful linux commands
Useful linux commands

Useful linux commands

  • rootuser# ls ———- list content in current directory
  • rootuser# ls -l ———- list content in long listing format
  • rootuser# ls -al ———- list all subcontent in long listing format
  • rootuser# ls -R ———- list content recursively
  • rootuser# ls -F ———- list content and classify them
  • rootuser# l. ———- list hidden files
  • rootuser# ll ———- an alias for the above
  • rootuser # find ——————- Memory usage in byte
  • rootuser # find -m ——————- Memory usage in Megabyte
  • rootuser # find -g ————— Memory usage in gigabyte including free and used
  • rootuser# cd ———- change directory to…
  • rootuser# cd .. ———- change to parent directory
  • rootuser# cd – ———- change to previous directory
  • rootuser# cd ———- change to home directory
  • rootuser# cd ~ ———- change to home directory
  • rootuser# ^l ———- clear the screen
  • rootuser# fdsik -l ———- list partition
  • rootuser# ssh ———— default command for connecting to a remote Linux computer over the network.
  • rootuser# df -h ———- same as my computer in windows
  • rootuser# man ———- manual
  • rootuser# clear ———- clear the screen
  • rootuser# alias ———- display all aliases for current user
  • rootuser# alias ———- make alias eg alias c=’clear’
  • rootuser# unalias ———- remove alias eg unalias c
  • rootuser# cp ———- copy (for files)
  • rootuser# cp -a ———- copy (for directories)
  • rootuser# cp -p ———- copy and preserve date and time
  • rootuser# exit ———- log out from the system
  • rootuser# logout ———- log out from the system
  • rootuser# ^d ———- log out from the system
  • rootuser# mv ———- move OR rename
  • rootuser# rmdir ———- remove empty directory
  • rootuser# rm ———- remove (for files)
  • rootuser# rm -f ———- remove forcefully ( ” ” )
  • rootuser# rm -r ———- remove recursively (for directories)
  • rootuser# rm -rf ———- remove recursively and forcefully ( ” ” )
  • rootuser# clear ———- clear the screen
  • rootuser# ^l ———- clear the screen
  • rootuser# cat ———- display content of the file
  • rootuser# cat -n ———- display content of the file and number the lines
  • rootuser# cal ———- display calendar for current month
  • rootuser# ln -s ———- make a soft/sym/symbolic link
  • rootuser# ln ———- make a hard link
  • rootuser# hwclock ———- display the hardware clock
  • rootuser# hwclock –hctosys ———- set the system time from the hardware clock (NTP)
  • rootuser# date ———- display system date and time
  • rootuser# date -s ” ———- change system date and time in mm/dd/yy
  • rootuser# who am I ——— display current user, terminal and uptime
  • rootuser# w ———- display is details which files are open on which terminal
  • rootuser# who —– display users logged in the system with their respective terminals and time since logged in
  • rootuser#group —————– which groups a user is a member of
  • rootuser# id —————- display id info of current user
  • rootuser# id -u ————- display user id of current user
  • rootuser# id -un ————————— display username of current user
  • rootuser# id -g ————————- display group id of current user
  • rootuser# id -gn ——————————- display groupname of current user
  • rootuser# history ——————– display the list of the last 1000 commands
  • rootuser# ! 289 ———————– Run command 289 in history
  • rootuser#tail —————– listing of the last 10 lines of a file. 
  • rootuser# uptime ————————— display for how long the system has been running
  • rootuser# which —————- display the path of the binary
  • rootuser# whereis ———————– display all paths
  • rootuser# head —————– listing of the first 10 lines of a file
  • rootuser# less ————– —————- view files without opening an editor.
  • rootuser# vimtutor —————— vi manual with exercise in text based
  • rootuser# pico —————— pico manual with exercise in text based
  • rootuser# mcedit ———————— mcedit manual with exercise
  • rootuser# vi ———— text editor for writing
  • rootuser# curl —————– Retrieve information and files Uniform Resource Locators
  • rootuser# diff ———- compares two text files and shows difference in prompt
  • rootuser# echo ————————- to set or print environment variables
  • rootuser# find ————————- finds the file in directory
  • rootuser# exit —————— logout from system or terminal
  • rootuser#finger ———— short information of the user inclusing login ,full name ,home directory and mails.
  • rootuser# root ————- for checking connectivity of the devices connected on the network(LAN) or over the network(WAN).
  • rootuser# top ——— showing information of cpu and memory zombi process same as task manager in windows.

Leave a Reply