This command will output the following: mkdir: created directory '/home' The mkdir command does not produce any output by default, unless you specify the -v option, which will cause it to print the name of each directory it creates, like this: mkdir -v /home/user/documents/mydirectory # This command will create a new directory with the specified name, and you can then use the ls command to list the contents of the current directory and verify that the new directory has been created. The mkdir command is used to create directories. The pwd command does not take any options, so you can simply run it as shown above to print the current working directory. For example, if you are currently in the /home/user/documents directory, this command will change the current directory to /home/user.Īs you saw above, I used the pwd command, which is used to see the current directory. # This command will change the current directory to the parent directory of the current directory. # You can also use the cd command to navigate to the parent directory of the current directory. # For example, if you want to change the current directory to /var/www/html, you can use the following command: The cd command is used to change the current directory in Linux. In this output, the first column indicates the file permissions, the second column indicates the number of links to the file, the third and fourth columns indicates the owner and group of the file, the fifth column indicates the file size, the sixth and seventh columns indicate the last modified date and time, and the last column indicates the file or directory name. Then the ls command will output something like this: Here is an example of how to use it: ls įor example, if you use the following command: ls -l The ls command is used to list the contents of a directory. rsync - efficiently copy or synchronize files between computers.scp - securely copy files between computers.ssh - securely connect to a remote computer.unzip - decompress files compressed with zip.wc - count the number of lines, words, and characters in a file.uniq - remove duplicate lines from a file.apt, yum, rpm - package managers (Distro-based).tail - display the last few lines of a file.head - display the first few lines of a file.find - search for files and directories.chown - change the owner of a file or directory.chmod - change the permissions of a file or directory.mv - move or rename files and directories.pwd - print the name of the current directory.ls - list the files and directories in a directory.I've also added links to my in-depth articles that cover specific commands in more detail. And also, if you plan on renting VPS servers and things like that.įor each command - I have added the main syntax on how to use it and what the output should look like. I'm starting this reference off with the top 30 Linux commands you will use daily if Linux becomes your main operating system. And such commands have been documented extensively. The real key difference is that instead of clicking on things to perform an action, you type in a command. I think many people are naturally scared of working with a Linux server alone.īut it's no different than sitting in your WordPress dashboard all day. It's a lot cheaper and, in many ways, a lot more fun. And for nine of those years, it has been on DigitalOcean servers. I've been self-managing all my websites for more than twelve years now.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |