ComputersOS

Basic Linux Commands

When working with the Linux operating system , a huge number of different commands are used, from the simplest ones, to rare and little-known ones. First of all, beginners need to learn Linux commands, with the help of which it is possible to get information about other commands. Any Unix user must have used the man command. By typing man at the command prompt and then the command you are interested in, you can get the online help page. To exit the help, press the "q" key. There is also an alternative format for calling help - this is the info command. Its difference is that the content of the pages is presented on the screen in the form of separate sections and subsections, which are called nodes and sub-assemblies.

For convenient and fast work in the system it is vital to know the basic Linux commands for working with files. With the ls command, you can list the attributes of files and directories. Using this command without parameters, you will see the files and directories that are contained in the current directory. Note that by default ls hides certain files whose names start with a dot. The cp command is used to copy files. First you need to specify the source file, and then the path to copy it to. The mv command is used either to rename files, or to move them to another directory. Rm is used to delete files, if you use the -r option, you can recursively delete entire directories.

Important enough are the Linux commands for working with directories. To change the current directory, you need to use a command such as cd. If you need to find out which directory the user is in at the moment, you should type pwd command, and the absolute path of your directory will be displayed. Linux commands mkdir and rmdir respectively add and remove directories. It should be noted that the rmdir command can only delete empty directories, you need to use the rm command to completely destroy directories and all content.

In Linux, you will definitely need to look at different types of files: text, scripts, binary data, and more. Therefore, you should consider Linux commands for viewing files. The most simple program can be called cat, whose task is to copy files to the output stream. If there are several files, the team will unite them. You can often use the less command to paginate the text. The tail command displays the last 10 lines of the file. Looks like the command head, with which you can read the first 10 lines of the file.

In a separate group, Linux commands are allocated for creating and editing files. The touch commands are usually used to create an empty file. To change the text files is most convenient with the help of editors, which there is a huge amount. The most popular are nano, vi, vim, gedit, kate.

There are also commands that help you learn about the properties of files. For example, the wc command is used to count the number of bytes, individual words, and lines in the file. To find out how much disk space is occupied by files and folders, you need to use the du command. An important role in the Linux operating system is played by access rights. To change them, the chmod command exists. Moreover, the rights are recorded simultaneously for three different types of users: for the owner of the file, for the group to which the owner belongs, and for all other users. The command argument that specifies the permissions can be written in one of two formats: numeric or character. Find the file using the find command.

Useful for beginners will be the commands of compression and packaging. The most popular is the tar command, which converts a number of files into an archive without any prior compression. Such an archive is called a tarball. To create a compressed archive, add several keys to the tar command.

Similar articles

 

 

 

 

Trending Now

 

 

 

 

Newest

Copyright © 2018 en.birmiss.com. Theme powered by WordPress.