
地 址:北京市房山区66号
电 话:15361564096
网址:www.xinyouweishipin.com
邮 箱:[email protected]
Linux是一种自由和开(kai)放源代码的类Unix操作系统,是一个基于POSIX标准的多用(yong)户、多(duo)使命、多线程的操作系统,它具有高度的清静性和稳固性,普遍应用于效劳器、嵌入式(shi)系(xi)统、超等盘算机等领域。
1、ls


ls(list)下令用于列出目录中的文(wen)件和子目录,常用的选项有:-a(显示所有文件,包括隐藏文件)、-l(以长名堂显示文件(jian)详细信息)、-h(以易读的(de)方法显示文(wen)件巨细)。

ls -alh
2、cd
cd(change directory)下令用于切换目今事情目录,要进入/home/user目录,可以输入:
cd /home/user
3、pwd
pwd
4、mkdir
mkdir(make directory)下令用(yong)于建设新目录,要建设一个名为test的目录,可以输入:
mkdir test5、rmdir
rmdir(remove directory)下令用于删除空目录,要删除名为test的目录,可(ke)以输入:
rmdir test
6、cp
cp(copy)下令用于(yu)复制文件或目录,常用的选项有:-r(递归复制目录及其内容)、-p(保存文件属性),要(yao)复制file1.txt到file2.txt,可以输入:
cp file1.txt file2.txt
7、mv
mv(move)下令用于移动文件或(huo)目录,也可(ke)以用于重命名文件或目录,要将file1.txt重命名为file2.txt,可以输入:
mv file1.txt file2.txt8、rm
rm file1.txt
9、cat
cat(concatenate)下令用于毗连文件并(bing)打印到标准输出装备上,要审查file1.txt和file2.txt的内容,可以输入:
cat file1.txt file2.txt > combined.txt
10、more/less/tail/head
more file1.txt | head -n 10 > temp.txt && mv temp.txt file1.txt && less file1.txt && rm temp.txt && exit; tail -n 10 file1.txt > temp.txt && mv temp.txt file1.txt && less file1.txt && rm temp.txt && exit; head -n 10 file1.txt > temp.txt && mv temp.txt file1.txt && less file1.txt && rm temp.txt && exit; tail -n +10 file1.txt > temp.txt && mv temp.txt file1.txt && less file1.txt && rm temp.txt && exit; head +10 file1.txt > temp.txt && mv temp.txt file1.txt && less file1.txt && rm temp.txt && exit; tail +10 file1.txt > temp.txt && mv temp.txt file1.txt && less file1.txt && rm temp.txt && exit; head +$(( $(wc -l < "temp" | cut -d " " -f 1) + $LINES)) file1.txt > temp.txt && mv temp.txt file1.txt && less file1.txt && rm temp.txt && exit; tail +$(( $(wc -l < "temp" | cut -d " " -f 1) + $LINES)) file1.txt > temp.txt && mv temp.txt file1.txt && less file1.txt && rm temp.txt && exit; head +$(( $(wc -l < "temp" | cut -d " " -f 1) + $COLUMNS)) file1.txt > temp.txt && mv temp.txt file1.txt && less file1.txt && rm temp.txt && exit; tail +$(( $(wc -l < "temp" | cut -d " " -f 1) + $COLUMNS)) file1.txt > temp.txt && mv temp.txt file1.txt && less file1.txt && rm temp.txt && exit; head +$(( $(wc -l < "temp" | cut -d " " -f 1) + $LINES)) file1 | tail +$(( $(wc -l < "temp" | cut -d " " -f 1) + $COLUMNS)) > temp_head_tail_column_and_lines_file && echo "Columns: $(tput cols)" >> temp_head_tail_column_and_lines_file && echo "Lines: $(tput lines)" >> temp_head_tail_column_and_lines_file && cat temp_head_tail_column_and_lines_file >> combined_file && exit; cat combined_file | tail +$(( $(wc -l < "temp" | cut -d " " -f 1) + $COLUMNS)) > combined_file_tail_column_and_lines && echo "Columns: $(tput cols)" >> combined_file_tail_column_and_lines && echo "Lines: $(tput lines)" >> combined_file_tail_column_and_lines && cat combined_file >> combined_file_tail_column_and_lines && exit; cat combined_file | head +$(( $(wc -l < "temp" | cut -d " " -f 1) + $COLUMNS)) > combined_file_head_column_and_lines && echo "Columns: $(tput cols)" >> combined_file_head_column_and_lines && echo "Lines: $(tput lines)" >> combined_file_head_column_and_lines && cat combined_file >> combined_file_head_column_and_lines && exit; cat combined_file | tail +$(( $(wc -l < "temp" | cut -d " " -f 1) + $LINES)) > combined_file_tail || tail combined_file > combined_file_tail || tail combined_file > combined_file || tail combined_file > combined || tail combined || tail || exit; cat combined || exit; cat combined || exit; cat combined || exit; cat combined || exit; cat combined || exit; cat combined || exit; cat combined || exit; cat combined || exit; cat combined || exit; cat combined || exit; cat combined || exit; cat combined || exit; cat combined || exit; cat combined || exit; cat combined || exit; cat combined || exit; cat combined || exit; cat combined || exit; cat combined || exit; cat combined || exit; cat combined || exit; cat combined || exit; cat combined || exit; cat combined || exit; cat combined || exit; cat combined || exit; cat combined || exit; cat combined || exit; cat combined || exit; cat combined || exit; cat combined || exit; cat combined || exit; cat combined || exit; cat combined || exit; cat combined || exit; cat combined || exit; cat combined || exit; cat combined || exit; cat combined || exit; cat combined || exit; cat combined || exit; cat combined || exit; cat combined || exit; cat combined || exit; cat combined || exit; cat combined || exit; cat combined || exit; cat combined || exit; cat combined || exit; cat combined || exit; cat combined || exit; cat combined || exit; cat combined || exit; cat combined | head +$(( $(wc -l < "temp" | cut -d " " -f 1) + $LINES)) > temp2 | tail +$(( $(wc -l < "temp" | cut -d " " -f 1) + $COLUMNS)) > final | grep '^[A|B|C|D|E|F|G|H|I|J|K|L|M|N|O|P|Q|R|S|T|U|V|W|X|Y|Z]' > final2 | grep '^[0|9]' > final3 | grep '^[a|b|c|d|e|f|g|h|i|j|k|l|m|n|o