Ls LS-L Ls-A More + Example /pattern Emacs + Example CD Path Ls Path PWD CP
The document lists basic UNIX commands for navigating directories, viewing files, editing files, copying/moving files, creating directories, searching for files, redirecting command output, and getting command help. Some key commands are ls to list files, cd to change directories, pwd to show the current directory, cp to copy files, and man to view command manuals. Pipelines and wildcards are also discussed.
Download as DOCX, PDF, TXT or read online on Scribd
0 ratings0% found this document useful (0 votes)
17 views
Ls LS-L Ls-A More + Example /pattern Emacs + Example CD Path Ls Path PWD CP
The document lists basic UNIX commands for navigating directories, viewing files, editing files, copying/moving files, creating directories, searching for files, redirecting command output, and getting command help. Some key commands are ls to list files, cd to change directories, pwd to show the current directory, cp to copy files, and man to view command manuals. Pipelines and wildcards are also discussed.
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2
Basic UNIX commands
Ls To list the files
Ls-l To list the files in a long format (+size,
last modified, its owner) Ls-a Lists all the files (by size, by date)
More + example Shows the first part of the screen, to
show more hit the spacebar /pattern T
Emacs + example An editor that lets you create and edit a
file. cd path Changes the current working directory
ls path Shows a listing of a specific file or
directory pwd Shows the user’s current working directory. cp Copies a file.
mv Moves (renames) a file or directory.
Mkdir path Creates a new directory
.. Means ‘the directory above the current
one’ . On its own means ‘the current directory’. * Matches zero or more characters in a filename *.txt matches all files ending in txt cat Displays the contents of a file
head Displays the first 10 lines of its input.
tail Displays the last 10 lines of its input.
sort Used to sort a file
wc counts lines, words, and characters in
command > file redirects a command’s output to a file
(overwriting any existing content). command >> file Appends (add something to the end of a written document) a command’s output to a file. < Redirects input to a command
first | second Is a pipeline: the output of the first
command is used as the input to the second. Ctrl-R To search through the previously entered commands. history to display recent commands
!number To repeat a command by number.
1 bash filename runs the commands saved in a file.
find finds files with specific properties that
match patterns. grep selects lines in files that match patterns.
--help is a flag supported by many bash
commands, and programs that can be run from within Bash, to display more information on how to use these commands or programs. man command displays the manual page for a given command. $(command) inserts a command’s output in place.