LINUX COMMANDS PART- 1

  • date 14th January, 2022 |
  • by Prwatech |
  • 0 Comments

The command to check the current Directory

 

pwd

 

NOW, WE WILL LEARN TO CHANGE THE DIRECTORY OR FOLDER 

1) If you want change your directory  

Command:

 

cd Desktop

 

NOTE: Linux is case sensitive so careful with the letters  

 

If your by mistakenly type desktop instead of Desktop you will get error as shown below: 

Command:

cd desktop



bash: cd: desktop: No such file or directory 

2) Again if you check the path 

Command: 

 

pwd

Output:  

/home/user/Desktop 

 

if you want to come back from Desktop 

Command: 

cd  ..


Before:  

home/user/Desktop 

Output:  

/home/user  

3)  If you want to toggle between the directory  

Command:

cd ~

HERE ARE THE SOME INITIAL COMMANDS: 

command  Result 
clear  If you want clear the terminal 
Logname  for display the current user 
tty  for the current terminal 
pwd  To check the path 
uptime  Time of OS 
uname  Name of the OS 
uname   -p  Processer of OS 
uname  -r  Version of OS 
uname  -v  Release date of OS 
uname   -n  Host name of OS 
uname  -a  Info of OS 
uname  -m  Hardware name 
 
hostname  Ubuntu 
hostname  -a  Alies name of Hostname 
hostname  -f  Fully hostname 
hostname  -i  IP address of the hostname 
hostname  -s  Display the short name 

 

who  Who connected to the server 
who am i  User 
who  -b  System boot time 
who  -d  Dead  process 
who  -h  Display heading 
who  -l  Ideal  time 
who  -u  list of user login 
w  -V  Display version 
w  Logged in avg load 
cal  calendar 
exit  To exit from the terminal 
id –u  To check the user id 
id  -g  To check the group id 

 

 

 

 

Here are some commands which are very much useful command in Linux 

  1. To check the current directories
ls  

a.txt  corona.txt  dumy  guru  lin  poi  rajkumar  hadoop.2.7.3.tar.gz w.txt 

a.txt  the one with the white color is text file 

dumy the one with blue color is directory 

hadoop.2.7.3.tar.gz the one with red color is zip file 

 

Suppose if you want one – by – one then,

 

ls -1 


a.txt 

corona.txt 

dumy 

lin 

megha.txt 

poi 

rajkumar 

w.txt 

 

To list out all hidden objects(.

 

ls-a

To list out all hidden objects(without . And .. profile

 

ls -A

To check in detail about the directories 

 

ls -l

 

COLUMN FORMATE: 

drwxr-xr-x  permission 
2  link 
User  username 
User  Group 
892  Size in bits 
Dec 29 01:46  Date and time 
corona.txt  Object name 

 

 

To display the objects which are ends with “ / , @ , * , = ” 

 

ls -F

 

NOTE:  

1) TO CLEAR THE TERMINAL TYPE CLEAR SHORT-CUT KEY IS (CTRL+L) 

2) TO EXIT FROM THE TERMINAL TYPR EXIT    

 To list out the objects in reverse order

 

ls  –r

 

 

 To list out the objects in recursive order 

 

ls –R

To list out objects w.r.t. their modification time

 

ls  -t

To list out objects separated by comma, 

 

ls  -m

 

To list out objects in multiple columns

ls  -x

list out all objects with  inode number

 

ls  -i

 

To list out display in human readable formate

 

ls  -h

To list out all the objects with 7 column formate w.r.t  modification time(t)

 

ls  -lt

 

To list out all the objects with  its size (size in bits)

 

ls  -s

 

To list out all the objects w.r.t size (size in bits) 

 

ls  -S

 To list out all the objects w.r.t their access time(u) 

 

ls  -u

To list out all the objects in reverse order along with 7 column formate w.r.t  modification time(t)

 

ls  -lrt

To list out all the objects in reverse order along with w.r.t their access time(u)

 

ls –lru

 

To list out all the objects in reverse order along with w.r.t their size(s) 

 


Shapels  -lrs

To list out all the objects with 7 column formate w.r.t. their id number and group id number

 

ls  -n

 

To list out all the objects and hidden file present in entire file system. 

 


ls   –lar

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Quick Support

image image