Terminal Shortcuts
CTRL L = Clear the terminal SHIFT Page Up/Down = Go up/down the terminal head = from the top CTRL A = Cursor to start of line CTRL E = Cursor TO end of line CTRL U = Delete left of the cursor CTRL K = Delete right of the cursor CTRL W = Delete word on the left of the cursor CTRL Y = Paste (after CTRL U,K or W) TAB = auto completion of file or command TAB TAB = shows you the options of commands !! = repeat last command CTRL Z = stops the current Basic navigation
ls -a = list all files and folders ls <folderName> = list files in folder ls -lh = Detailed list, Human readable ls -l *.jpg = list jpeg files only ls -lh <fileName> = Result for file only cd <folderName> = change directory if folder name has spaces use “ “ cd / = go to root cd .. = go up one folder pwd = print working directory man <command> = shows manual |
File Manipulation
cat <file name > show content of the file mkdir = create new folder mkdir <name> cp = copy and rename a file cp -R = copy and rename a file mv <txt file name> <foldername> = move a file to a folder mv <foldername> <foldername> = move folder into another folder mv <txt filename> <txt filename>= rename file rm <filename>= delete file or files with rm <filename> <filename1>... rm -i <filename> = ask for confirmation on each file touch <filename> = create or update a file File Manipulation continued
head -n <#oflines> <txt fileName>= writes the no of lines of the file (from the top) to the screen tail -n <#oflines> <txt fileName> = writes the no of lines of the file (from the bottom) to the screen less <txt fileName> = wtites the contents of a file onto the screen one page at a time;use space bar to continue more <txt fileName> = wtites the contents of a file onto the screen. |
File Manipulation continued1
grep <textuwanttosearch> <fileName> = search for text in file grep -i = Ignores uppercase/lowercase when searching grep -v = displays lines that do not match grep -n = puts a line number in front of each matching line number grep -c = prints the total count of the matched lines grep -r <text> <folderName>/ = search for file names with occurrence of the text |
Cheatography
https://cheatography.com
Linux Cheat Sheet by tester1
Linux
Created By
Metadata
Favourited By
Comments
No comments yet. Add yours below!
Add a Comment
Related Cheat Sheets