Useful Linux commands

These are the few commands related to Ubuntu and work with all other Linux distributions.

System Information Commands

1.df: The df command displays filesystem and disk usage for all partitions. The command df -h uses megabytes(M) and gigabytes(G) to report.
2.free: The free commands displays the amount of free and used memory in the system. free -m will give the information using megabytes.
3.top: The top command displays information om your Linux system,running process and the system resources,including the CPU,RAM,swap,usage and total number of tasks being run. 
4.uname -a : lsb_release command  shows version information for the Linux release you are running.
5.ifconfig: This reports on your system's network intefaces.
6.iwconfig : The command will show any wireless network adapters and the wireless specific information from them,such as speed and network connected.
7.ps : The command ps allows you to view all the process running on the machine.
8.lsusb: The command lists all the USB buses and any connected USB devices such as printers and the thumb drivers.
9.lshw : The command lshw lists hardware on your system, including maker, type and where it is connected.

File system commands

These are the commands which are used for moving around the file system.

1.pwd : pwd stands for "print working directory".The pwd command will tell you the directory in which you are located.
2.cd : The cd command lets you change directories. To move around the file system you have to use cd.

Manipulating Files and Folders
You can manipulate files and folders using the following commands:

1.cp : The cp command will make a copy of a file for you.
2.mv : The mv command will move a file to a different location or will rename a file. eg. mv file foo will rename the file "file" to "foo".
               mv foo ~/Desktop will move the the file "foo' to desktop directory.
3.rm : Use this command to remove or delete a file in your directory.It will not work on directories in which there are files.
4.ls : The ls command will show you the files in your current directory
5.mkdir : The mkdir command will allow you ro create directories.eg mkdir photos, will create photos directory.
6.chown : The chown command allows the user to change the user and group ownerships of a file.

Dealing with Users and the Groups
You can use following commands to administer users and groups:

1.adduser : The adduser command will create a new user. eg. sudo adduser username. This will create the user home directory and the default group. It will prompt for a user password and then further details about the user.
2.passwd : The passwd command will change the user's password.
eg. sudo passwd .This will prompt for new user passwd.
3.who :The who command will tell you who is currently logged into the machine.
4.addgroup: The addgroup command will add a new group.To create a new group type sudo addgroup groupname.
5.deluser : The deluser command will remove a user from the system.To remove their files and home directory
eg . sudo deluser username
6.delgroup : The delgroup command will remove a group from the systems.You cannot remove a group that is the primary group of any users.

Related posts
10 Linux commands you should know

1 comments:

very nice and Informative, preparing for linux Certification, wanted to learn some linux Commands,recently joined in http://www.kerneltraining.com/linux-admin-training/, can anyone suggest me some books and videos.

Post a Comment