Linux Essentials PPT-CH02_Final
Linux Essentials PPT-CH02_Final
Cybersecurity
pwd
Displays the current directory
cd
Changes to another directory
Accepts a single argument, the desired directory
Example: cd /etc
file
Reports the type of content in a file
less
Displays large chunks of text data, pausing after
displaying the first page of information
Keys on keyboard enable user to scroll through
the document
Spacebar: one page forward
b: one page back
Enter or down arrow: down one line
Up arrow: up one line
q: return to the shell
HOME
ID
LOGNAME
OLDPWD
PATH
PS1
PWD
Piping
Routes the output of a command to another
command
Uses the “pipe” symbol: |
Example: ls –l /etc | grep “Apr 16”
Subcommands
To use one command’s output as an argument in
another command, place the command within the
$( ) characters
Example: echo “Today is $(date)”
© 2019 by Pearson Education, Inc. Chapter 2 Working on the Command Line 27
Regular Expressions (REs)
grep
Searches files for lines that contain a specific
pattern
Example: grep “the” /etc/rsyslog.conf
sed
Edits file data in a non-interactive method
tar
Merges multiple files into a single file
gzip
Creates a compressed version of the file
Use gunzip to decompress gzipped files
bzip2
Replaces the original file with the compressed file
xz
Compresses files