Use LEFT and RIGHT arrow keys to navigate between flashcards;
Use UP and DOWN arrow keys to flip the card;
H to show hint;
A reads text to speech;
53 Cards in this Set
- Front
- Back
exec
|
Runs a program that replaces the current shell. When the program terminates, it's as if you terminated the shell.
|
|
time
|
Times how long a command takes to execute. Displays total execution time, CPU time, and system CPU time.
|
|
pwd
|
print working directory
|
|
history
|
~/.bash_history keeps a record of every command you type. Use up and down arrows to review your command history.
-c clears the history |
|
mkdir
|
Creates a directory.
-p create parent directories as well |
|
touch
|
Update the access and modification times of each file named. Creates an empty file if file doesn't exist.
example: touch file1 file2 file3 |
|
ls
|
List files.
-l include file type, permissions user:group, bytes, and date modified -a include hidden files |
|
bash configuration files
|
/etc/profile
/etc/bash.bashrc ~/.profile ~/.bashrc .profile system-wide settings, typically configures PATH and other environment variables. .bashrc settings for login shells, typically includes command aliases and umask settings |
|
env
|
display environment variables
|
|
Standard input
Standard output Standard error |
> creates/overwrites stdout to file
>> creates/appends stdout to file 2> creates/overwrites stderr to file 2>> appends/overwrites stderr to file &> creates/overwrites stdout and stderr to file < redirect stdin from file | pipes stdout from one program to stdin on another redirecting to /dev/null discards output |
|
tee
|
Read from standard output and write to standard output and files.
-a append to given files |
|
xargs
|
xarg [options] command
Runs command for every word passed on standard input. |
|
find
|
find [options] [expression]
Find files. Use * for glob searches. -name [pattern] find by name -iname [pattern] case insensitive -user [username] files owed by user -nouser files unknown user -nogroup files unknow group -perm [mode] files with mode permissions -type [filetype] d for directory, f for regular file, s for socket, p for pipe |
|
cat
|
Concatenate files to stdout
-n adds line numbers -b only adds line numbers to nonblank lines -v displays control characters |
|
tac
|
Same as cat but reverses the order of lines.
|
|
join
|
Join two files by matching contents of specified fields. Requires same ordering of lines, which can be done by sort.
-1 [fieldnum] join on file 1 field number fieldnum -2 [fieldnum] join on file 2 field number fieldnum -i ignore case -t [char] use char as separator |
|
paste
|
Merges files line by line.
|
|
expand
|
Convert tabs to spaces.
-t [num] num number of spaces for each tab |
|
unexpand
|
Convert spaces to tabs.
-t [num] num number of spaces for each tab |
|
od
|
Display file in octal.
-x display in hex |
|
sort
|
Sort file.
-f ignore case -n sort by number -r reverse sort -k [num] sort by num field first |
|
split
|
Split a file into two or more files.
-b [size] split files into size bytes -l [num] split files into num lines |
|
uniq
|
Remove adjacent duplicate lines. You can use sort to remove all duplicates.
example: sort duplicates.txt | uniq > deduped.txt |
|
tr
|
tr [options] [set1] [set2]
Translate file set1 to set2. -d delete from file example1: tr -d '\r' file.txt deletes carrage returns from file example2: tr "[:upper:]" "[:lower]" file.txt translates uppercase to lowercase example3: tr "[a-z]" "[A-Z]" file.txt translates lowercase to uppercase |
|
Split a file into 2000 byte files.
|
split -b 2000
|
|
Split a large file into 20 line files.
|
split -l 20
|
|
Sort a file.txt by it's third field, space separated.
|
sort -k 3 file.txt
|
|
Do a case insensitive join on field 3 from file1.txt and field 2 from file2.txt using comma as field separator.
|
join -i -t "," -1 3 -2 2 file1.txt file2.txt
|
|
Concatenate file1.txt and file2.txt into combined.txt
|
cat file1.txt file2.txt > combined.txt
|
|
In the current directory list all hidden directories starting with kde.
|
find ./ -type d -iname ".kde*"
|
|
Find all the temporary files in the current directory and remove them.
|
find ./ -name "*~" | xargs rm
|
|
Display and save a list of files in the current directory to dirlist.txt
|
ls -l | tee dirlist.txt
|
|
Find the debian package the command mkfs belongs to.
|
dpkg -S `which mkfs`
|
|
yum configuration files
|
/etc/yum.conf
/etc/yum.repos.d/ |
|
Create a cpio archive of files in the current directory.
|
ls | cpio -ov > archive.cpio
|
|
Extract archive.cpio to currect directory, overwriting any existing files and creating any needed directories
|
cpio -iduv < archive.cpio
|
|
uptime
|
Display the current time, how long the system has been running, how many users are currently loggon on, and the system load averages for the last 1, 5, and 15 minutes.
|
|
fmt
|
Format long lines of text to 75 characters
-w [num] set width to num characters |
|
Install binary-tarball.tar.gz in debian, adding all the files to the package management database.
|
alien --install binary-tarball.tar.gz
|
|
Number all non blank lines of file.txt
|
nl file.txt
cat -b file.txt |
|
pr
|
Prepare text file for printing. Format to 80 character line width. Add page header with current date and time, original filename, and page number.
|
|
head
|
Print first 10 lines of each file.
-c [num] print num bytes -n [num] print num lines |
|
tail
|
Print last 10 lines of file.
-c [num] print num of bytes -n [num] print num lines -f [filename] ouput appended data as file grows |
|
Display the last ten lines of /var/log/dmesg and view data as it's appended.
|
tail -f /var/log/dmesg
|
|
wc
|
Print newline, word, and byte counts.
-l print line count only -c print byte count only -w print word count only |
|
dpkg-reconfigure
|
Reconfigure an installed debian package.
|
|
nice
|
Run a process with high or low priority, -20 highest to 19 lowest.
|
|
renice
|
Change a running process's priority higer or lower, highest -20 to lowest 19.
|
|
Change all processes owned by user1 and user2 to a priority of 6.
|
renice +6 -u user1 user2
|
|
Change process to priority -5 for PID1 and PID2
|
renice -5 -p PID1 PID2
|
|
kill
|
Send signal to process.
|
|
killall
|
Kill all instances of a program.
-i prompt for each process -s, --signal [SIGNAL] send SIGNAL to each process |
|
lspci
|
List PCI devices.
-v verbosity (-vv, -vvv) -t tree view |