Linux Commands - Mithun Technologies-1
Linux Commands - Mithun Technologies-1
Linux Commands - Mithun Technologies-1
[email protected]
+91-9980923226
Linux Commands
Revision History
Document Event Date Who Version Comments
No.
Linux file system is casesensitive. (Mithun and mithun both are different)
Hidden files start with . (dot) extension.
dot (.) refers to current dir.
§ echo : For display purpose we will use. Like System.out.print() method in Java.
§ cat : Display the contents of a file
§ head : Print the first 10 lines of each FILE to standard output.
§ tail : It will display the last 10 rows.
§ more :It is a filter for paging through text one screenful at a time (stop the display on each
screen)
§ less : less is the same except you can scroll back and forward.
§ sort: It is used to sort the output in numeric or alphabetic order .
§ tr: Translate characters
§ sed: Stream editor.
§ grep: which stands for "global regular expression print," processes text line by line and prints
any lines which match a specified pattern.
System Resources Commands
§ who : Displays the current users working on the system.
§ w : Show who is logged on and what they are doing
§ users : Displays a compact list of the users currently logged on the system.
§ whoami : Display the current user info who gave this command
§ whereis : Path/locate the binary, source, and manual page files for a command.
§ date : Print or set the system date and time
§ df : Report file system disk space usage
§ du : Estimate file space usage.
§ hostname : Show or set the system host name.
§ ifconfig (OR) hostname -i (OR) ip a : To find the IP address.
§ man : Display the on-line manual pages.
§ info:
§ help:
§ whatis: The whatis command displays a summary line from the man page for the specified
command in Linux.
§ service : It will give the status of service.
§ systemctl list-unit-files: It will list all services.
§ uptime: Tells how long the system has been running.
§ last: show listing of last logged in users.
Process Management Commands
§ useradd : Creates
a new user account. ---> Only root user can execute this command
§ passwd : Changes a user's password
§ Note: Old password is first requested then new password is requested twice for confimation
§ chage : It is used to see user related “threshold details” such as user disable time etc.
§ groupadd : create a new group ---> Only root user can execute this command
§ usermod : Changes user attributes. ---> Only root user can execute this command
§ id : It is one more command which will show the user details such as his primary group and
his secondary group.
§ groups : Displays group membership. Means display the user belongs to which groups.
§ lid: Display user’s groups or group’s users. à Only root user can execute.
§ su : To switch user. To come out from the user press Ctrl+d, logout or exit.
§ sudo : Execute a command as another user.
§ userdel : Removes a user account. ---> Only root user can execute this command
§ groupdel : Delete group. ---> Only root user can execute this command
Automating/Scheduling Tasks Commands
§ Cron: Cron is a daemon that executes scheduled commands. Cron also reads /etc/crontab.
crontab: Crontab is the program used to install, deinstall or list the tables used to drive the cron
daemon in Vixie Cron.
Crontab format:
§ free: To find the amount of free and used RAM memory in the system.
§ dmidecode -t 17 : It Give the RAM information like Type of RAM(SD RAM, DRAM or
DDR2/3), Speed, Manufacture etc --> Root user can perform this command
§ vmstat: I will gives the virtual memory statistics.
Communication Commands
[email protected]
+91-9980923226