CentOS7 命令行

ls -a: 查看当前目录所有文件 包括以.开头的隐藏文件
ls -l:查看当前目录的文件的详细信息,ls -l亦可缩写为ll
ls -al:也就是两个指令的叠加使用

cd / : 代表进入根目录,也就是计算机目录,
cd ~ : 表示切换到 home 目录的意思,相当于cd /home/用户名,
cd . : 则是表示切换到目前所在的目录,
cd ..: 则表示切换到目前目录位置的上一层目录。
当进入终端后其默认在home目录下
~$默认表示此时在home目录
pwd(Print Working Directory):当前路径查看命令

usage : uname [option]
a, --all print all information, in the following order,
except omit -p and -i if unknown:
-s, --kernel-name print the kernel name
-n, --nodename print the network node hostname
-r, --kernel-release print the kernel release
-v, --kernel-version print the kernel version
-m, --machine print the machine hardware name
-p, --processor print the processor type or "unknown"
-i, --hardware-platform print the hardware platform or "unknown"
-o, --operating-system print the operating system
--help display this help and exit
--version output version information and exit

clear:清屏命令

cat(Concatenate files and print on the standard output):查看文件内容命令

sudo(Super User do):带有超级用户权限执行的前缀命令

touch:触摸命令
修改文件或者目录的时间属性,若文件不存在,系统会建立一个新的文件。
我记touch的方法是这个文件给我touch过,也就是给我碰过

Usage: mkdir [OPTION]... DIRECTORY...
Create the DIRECTORY(ies), if they do not already exist.

Mandatory arguments to long options are mandatory for short options too.
-m, --mode=MODE set file mode (as in chmod), not a=rwx - umask
-p, --parents no error if existing, make parent directories as needed
-v, --verbose print a message for each created directory
-Z, --context=CTX set the SELinux security context of each created
directory to CTX
--help display this help and exit
--version output version information and exit

mkdir(Make Directoriy):创建目录命令(也就是新建文件夹)
mv(Move):移动命令(也具有重命名功能)

如前者为文件后者为文件夹的情况下:
mv main.c MDK
即把main.c文件移动到MDK目录下

又比如两者均为文件的情况下:
mv main.c test.c
即把main.c文件更名为test.c文件

又比如两者均为文件夹的情况下:
mv MDK keil5
当前情况是文件夹keil5已存在的情况,即会把MDK文件夹移动到目录名为keil5的目录下;倘若keil5这个文件夹不存在,则MDK文件夹会更名为文件名为keil5的文件

cp(Copy):拷贝命令
比如:
cp main.c main1.c
即把main.c文件复制然后粘贴到该目录下 然后新的文件的文件名为main1.c

又或者比如现在在home目录下有两个文件夹,一个叫mdk一个叫keil5,然后mdk目录下有个叫main.c的文件,我想把mdk目录下的main.c这个文件复制到home目录下的keil5文件夹里,就必须得在父目录下执行复制操作
即:
cd ~
cp mdk/main.c keil5

Usage: rmdir [OPTION]... DIRECTORY...
Remove the DIRECTORY(ies), if they are empty.

  --ignore-fail-on-non-empty
              ignore each failure that is solely because a directory
                is non-empty

-p, --parents remove DIRECTORY and its ancestors; e.g., rmdir -p a/b/c' is similar to rmdir a/b/c a/b a'
-v, --verbose output a diagnostic for every directory processed
--help display this help and exit
--version output version information and exit

ifconfig(Network interfaces configuring):配置网络指令

reboot:重启命令
poweroff:关机命令
man(Manual):系统帮助命令
man gegit

gedit main.c
系统就会以gedit文本编辑器打开main.c,更改完后可以cat一下进行查看

file main.c
系统就会在终端上显示main.c的文件类型等信息

tree:以树状图形式列出当前目录内容的命令
它会列出指定目录下的所有文件,包括子目录里的文件,以及会以树状形式显示父子目录的关系

posted @ 2023-03-13 22:27  诸葛蛋蛋  阅读(120)  评论(1编辑  收藏  举报