Commands in Sections
Commands in Sections
it to the os to process. and it shows the output . linux's shell is its main
part ,linux has a CLI (command line interface).in this tutorial , we are going to
over the basic commands that we use in the shell of linux.
----------------------------------------------------------------------------
there are 3 types of user account types :
1- regular
2-root
3-service account
----------------------------------------------------------------------------
commands of linux
1- uptime ---> current system time and the duration for which system has been
running and number of users logged in and system load average
----------------------------------------------------------------------------
1- w command --> will display users currently logged in and their process along
with showing load averages , login name , tty name , remote host login time , idle
time , jcpu ,pcpu , command and processes
-----------------------------------------------------------------------------------
-
1- users -->command displays currently logged in users - this command doesn't have
other parameters other than help and version
-----------------------------------------------------------------------------------
-
1- who --> command simply returns the user name , date ,time and host information ,
who command is similar to w command unlike the w command who doesn't print what
users are doing
-----------------------------------------------------------------------------------
-
1- whoami -->command is used to print the currently logged in username into your
linux system , if you are logged in as a root using sudo command whoami commant
return root as the current user
-----------------------------------------------------------------------------------
-
1- uname -a -->display linux system information
-----------------------------------------------------------------------------------
-
1- date --> show the current data and time
21-ls -d $PWD/* --> list files and directories with full path
-----------------------------------------------------------------------------------
-
1- cat file name --> used to display the content of text files
2- cat file1 file2 file3 >file --> used to combine several files to one file
-----------------------------------------------------------------------------------
-
1- cp [option ] source destination --> copy the source in the destination
-----------------------------------------------------------------------------------
-
1- mv source destination --> move file or folder from source to destination
-----------------------------------------------------------------------------------
-
1- gzip [options] [filenames] --> is used to compresses files
3- zcat --> is used to look at a gzipped file without actually having to gunzip it
(same as gunzip -c)
-----------------------------------------------------------------------------------
-1- history --> lists commands you have done recently
-----------------------------------------------------------------------------------
-
1- df --> see how much free disk space
-----------------------------------------------------------------------------------
-
1- du --> estimate disk usage of directory in bytes
-----------------------------------------------------------------------------------
-
1- tail [option] file --> is used to output the last part of files
-----------------------------------------------------------------------------------
-
1- nano file --> to create file and write in the file
-----------------------------------------------------------------------------------
-
1- sudo useradd username --> to add new user
2- cat /etc/passwd --> to show all users
3- sudo chown user:group filename --> to change each user and group in one line
-----------------------------------------------------------------------------------
-
chmod --> used to reset permissions of the file or the folder