没有合适的资源?快使用搜索试试~ 我知道了~
50-Most-Used-Linux-Commands-pdf.pdf
需积分: 1 0 下载量 162 浏览量
2024-01-07
21:03:59
上传
评论
收藏 8.67MB PDF 举报
温馨提示
试读
47页
50-Most-Used-Linux-Commands-pdf.pdf
资源推荐
资源详情
资源评论
50 Most Used Linux Commands
Suppose, you've started to use Linux recently, and you’re quite new to the command line
interface. But one thing is certain: if you want to learn about some frequently used Linux
commands and practice them on your own then you’ve found the right place. Here, we’ve
discussed the 50 most used Linux commands with a brief description and practical
examples.
List of 50 Most Used Linux Commands
1. sudo command
Sudo can be referred as the supreme command. It is the abbreviation for “Super User DO”.
It allows a user to act as a superuser and run commands accordingly. One can run certain
commands prefixed by sudo with boosted rights. It is considered analogous to the “run as
administrator” process of Windows.
Synopsis
Useful Options
-D directory, --chdir=directory (executes the command in the specific directory)
-e (edits one or multiple files instead of executing commands)
-l (runs specific commands as the root user)
-u user, --user=user (executes the command as a user other than the specific default user)
Example
Any general user cannot install any packages on the machine. However, with sudo prefixed
with the command, the user can execute his/her task by providing his/her password.
2. pwd command
Pwd is the abbreviation for Print Working Directory. As the name suggests, it prints the name
of the current/working directory all the way beginning from the root(/) directory.
Synopsis
Useful Options
-L, --logical (Even as it carries symlinks, PWD utilizes from the environment. )
-P, --physical (avoid the symlinks)
When no option is mentioned, it is assumed that option -P is being used.
Example
Generally, Terminal prompts have a complete directory in the name. Otherwise, pwd
becomes a handy command to get insights about the current working directory.
3. cd command
Change Directory(cd) allows one to change one’s current directory to the desired directory
within the terminal.
Synopsis
Note: cd is a shell built-in command, it doesn’t have a dedicated man(manual) page.
However, you can get help using command help!
Useful Options
cd ~[username] — change the directory to the home directory of the specified user.
cd .. — changes directory one directory up the current directory.
cd - — changes the directory to the previously changed directory.
Example
In our Desktop directory, we have a 3-level nested directory. we want to leap forward to the
level 3 directory by jumping one level at a time.
We have changed our mind, now we want to be at level2. Therefore, we just need to go one
directory backward which can easily be done by executing the command cd ..
Lastly, we have come to the conclusion that we want to be in the home(~) directory. This can
be simply done by executing cd ~ (tilde represents home directory).
4. ls command
Lists the contents, both files and subdirectories of the current directory by default. It is one
of the most used commands, as one can view the contents of a directory without exiting the
terminal and perform their desired tasks on the specific contents.
Synopsis
Useful Options
-a — doesn’t ignore the hidden files (files named with .(dot) at the beginning).
-h — print sizes in human-readable forms.
-l — lists in a long form.
-S — Sorts according to file size, largest first.
Example
After being at the root(/) directory, if we run the ls command we can view the contents of the
root directory.
5. cat command
Prints the contents of the file specified. Generally, cat (concatenates) reads the contents of
the files fed to its arguments and prints them serially on the terminal.
Synopsis
Useful Options
-n, --number — Displays line numbers when utilized.
Example
We can display the contents of a file simply by using the cat command followed by the file
name.
6. mv command
Mv is the abbreviation for move. As the name suggests it moves things from one place to
another place. mv moves one or multiple files to the specified destination directory. If the
directory doesn’t exist it just renames the files. mv can also be used to move directories and
their contents.
Synopsis
Useful Options
-i, --interactive (Displays interactive prompt before completing the modification)
-t, --target-directory=DIRECTORY (Moves every specified file to the targeted DIRECTORY)
-v, --verbose (Prints message of what is being performed.)
Example
In the desktop directory, there are two subirectories named Folder1 & Folder2 which
respectively contains two files named file1 & file2. Now lets move file2 to folder1.
剩余46页未读,继续阅读
资源评论
无心六神通
- 粉丝: 4304
- 资源: 22
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功