A number of programs and built-in shell commands are commonly used when working at the command line. These commands are organized here by category to help you understand the purpose of each category: Managing users and groups chage chfn chsh edquota gpasswd groupadd groupdel groupmod groups mkpasswd newgrp newusers passwd umask useradd userdel usermod Managing
Shutting Down the system Use the shutdown command to shut down your system. The shutdown command has a number of different command-line options (such as shutting down at a predetermined time), but the fastest way to cleanly shut down Linux is to use the -h (or halt) option, followed by the word now: You can
Creating Users When a Linux system administrator creates a user, an entry is created in etc/passwd for the user. The system also creates a directory, labeled with the user’s username, in the /home directory. For example, if you create a user named syuhada, the user’s home directory is /home/syuhada. After creating a user, you must
The root, or super user, account is a special account and user on UNIX and Linux systems. When logged in as root, you have total control over your system, which can be dangerous. When you work in root, you can destroy a running system with a simple invocation of the rm command like this: This
cat To view the contents of a text file named testfile on your screen, assuming that you are the user hadi, use this command: Text inside testfile is displayed on the screen but you cannot edit or work with the text. This command allow you to know the contents of a file but don’t want
To copy a file named testfile from ~/Documents to ~/Downloads, use this command: To copy a file that is in your current directory, you could use the following, and it will work exactly the same as mv, except that both files will exist afterward: To rename a file as you copy it form ~/Documents to
Moving and renaming a file are the same thing. It doesn’t matter whether you are moving the directory to another or from one filename to another filename in the same directory; there is only one command to remember. To move a file named testfile from ~/Documents to~/Downloads, use this command: If the destination is not
To delete a file named testfile, use this command: You can remove a file in a different location by changing what is after rm. To remove a directory in /home/hadi/Documents, if you are already un your /home directory, you can use the following: Or from anywhere using an absolute path, you can use this: Or
To delete an empty directory named subdir2, use the following command: I check first the directory, delete the directory when confirmed and verify the directory is deleted. You can remove a directory in a different location by changing what is after rmdir. To remove a directory in /home/hadi/Music, if you already in your /home directory,
To create an empty directory called testdirectory within your current directory, use this command: You can create a directory in a different location by changing what is after mkdir. To create a new directory in /home/hadi/music, if you are already in you /home directory, you can use the following: Or from anywhere using an absolute
Something went wrong. Please refresh the page and/or try again.
Follow My Blog
Get new content delivered directly to your inbox.