暂无图片
暂无图片
暂无图片
暂无图片
暂无图片
bash_cheat_sheet
193
7页
0次
2020-12-22
5墨值下载
freeworld.posterous.com
Linux Bash Shell
Cheat Sheet
(works with about every distribution, except for apt-get which is Ubuntu/Debian exclusive)
Legend:
Everything in “<>” is to be replaced, ex: <fileName> --> iLovePeanuts.txt
Don't include the '=' in your commands
'..' means that more than one file can be affected with only one command ex: rm
file.txt file2.txt movie.mov .. ..
Linux Bash Shell Cheat Sheet
Basic Commands
Basic Terminal Shortcuts Basic file manipulation
CTRL L = Clear the terminal cat <fileName> = show content of file
CTRL D = Logout (less, more)
SHIFT Page Up/Down = Go up/down the terminal head = from the top
CTRL A = Cursor to start of line -n <#oflines> <fileName>
CTRL E = Cursor the end of line
CTRL U = Delete left of the cursor tail = from the bottom
CTRL K = Delete right of the cursor -n <#oflines> <fileName>
CTRL W = Delete word on the left
CTRL Y = Paste (after CTRL U,K or W) mkdir = create new folder
TAB = auto completion of file or command mkdir myStuff ..
CTRL R = reverse search history mkdir myStuff/pictures/ ..
!! = repeat last command
CTRL Z = stops the current command (resume with fg in foreground or bg in background) cp image.jpg newimage.jpg = copy and rename a file
Basic Terminal Navigation cp image.jpg <folderName>/ = copy to folder
cp image.jpg folder/sameImageNewName.jpg
ls -a = list all files and folders cp -R stuff otherStuff = copy and rename a folder
ls <folderName> = list files in folder cp *.txt stuff/ = copy all of *<file type> to folder
ls -lh = Detailed list, Human readable
ls -l *.jpg = list jpeg files only mv file.txt Documents/ = move file to a folder
ls -lh <fileName> = Result for file only mv <folderName> <folderName2> = move folder in folder
mv filename.txt filename2.txt = rename file
cd <folderName> = change directory mv <fileName> stuff/newfileName
if folder name has spaces use “ “ mv <folderName>/ .. = move folder up in hierarchy
cd / = go to root
cd .. = go up one folder, tip: ../../../ rm <fileName> .. = delete file (s)
rm -i <fileName> .. = ask for confirmation each file
du -h: Disk usage of folders, human readable rm -f <fileName> = force deletion of a file
du -ah: “ “ “ files & folders, Human readable rm -r <foldername>/ = delete folder
du -sh: only show disc usage of folders
touch <fileName> = create or update a file
pwd = print working directory
ln file1 file2 = physical link
man <command> = shows manual (RTFM) ln -s file1 file2 = symbolic link
of 7
5墨值下载
【版权声明】本文为墨天轮用户原创内容,转载时必须标注文档的来源(墨天轮),文档链接,文档作者等基本信息,否则作者和墨天轮有权追究责任。如果您发现墨天轮中有涉嫌抄袭或者侵权的内容,欢迎发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。

评论

关注
最新上传
暂无内容,敬请期待...
下载排行榜
Top250 周榜 月榜