答:
1、
cp,mv,rm,cat(tac,more,less,tail),touch
其中常用的有:
cp(復制):
-i:交互式
-r, -R: 遞歸復制目錄及內部的所有內容;
[root@localhost tmp]# cp -r /var /tmp
-a: 歸檔
[root@localhost etc]# cp -a system-release /tmp
– v: –verbose 顯示詳細信息
-f: –force
rm:
-i: 交互式
-f: 強制刪除
-r: 遞歸
rm -rf:強制遞歸刪除
[root@totooco tmp]# rm -rf /tmp/mageedu/
cat:
-E: 顯示行結束符$
-n: 對顯示出的每一行進行編號
[root@localhost ~]# cat -n -E /etc/fstab
1 $
2 #$
3 # /etc/fstab$
4 # Created by anaconda on Tue May 3 07:14:15 2016$
5 #$
6 # Accessible filesystems, by reference, are maintained under '/dev/disk'$
7 # See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info$
8 #$
2、
命令執行狀態返回值:0為執行成功,1-255執行失敗
[root@totooco tmp]# ls
[root@totooco tmp]# echo $?
0
[root@totooco tmp]# lsss
bash: lsss: 未找到命令…
[root@totooco tmp]# echo $?
127
3、
(1)
[root@totooco tmp]# touch {a,b}_{c,d}
(2)
[root@totooco tmp]# mkdir -pv /tmp/mylinux/{bin,boot/grub,dev,etc/rc.d/init.d,sysconfig/network-scripts,lib/modules,lib64,proc,sbi
n,sys,tmp,usr/local/{bin,sbin},var/{lock,log,run}}
4、
元數據有size大小,blocks塊大小,修改時間訪問時間創建時間。
[root@localhost ~]# stat /etc
File: "/etc"
Size: 12288 Blocks: 24 IO Block: 4096 目錄
Device: 805h/2053d Inode: 262146 Links: 102
Access: (0755/drwxr-xr-x) Uid: ( 0/ root) Gid: ( 0/ root)
Access: 2016-05-28 15:20:41.928339515 +0800
Modify: 2016-05-30 11:09:06.164941362 +0800
Change: 2016-05-30 11:09:06.164941362 +0800
5、
[root@localhost tmp]# alias lr='ls -l /root'
命令引用:name=$(command)
6、
[root@localhost /]# ls -d /var/l*[0-9]*[[:lower:]]
7、
[root@localhost /]# ls -d /etc/[0-9]*[^0-9]
8、
[root@localhost /]# ls -d /etc/[^[:alpha:]][[:alpha:]]*
9、
[root@totooco tmp]# name=`date +%y-%m-%d-%H-%M-%S`
[root@totooco tmp]# echo $name
16-06-14-18-30-00
[root@totooco tmp]# touch /tmp/tfile$name
10、
[root@localhost /]# cp -a /etc/p*[^0-9] /tmp/mytest1
11、
[root@localhost /]# cp -a /etc/*[.d] /tmp/mytest2
12、
[root@localhost /]# cp -a /etc/[lmn]*.conf /tmp/mytest3
原創文章,作者:Net20_totooco,如若轉載,請注明出處:http://www.www58058.com/18591
寫的很棒,可以把題目也寫上,那樣會更加的美觀一些,在看看第10題