Bash Commands / Programs Flashcards
Clear
Clears the terminal
Cal
Shows date and time
Df
To see current amount of free space on our disks
Free
Display the amount of free memory
Pdw
Print a name of current work directory, tells you what directory you are in.
Cd
Change work directory
-a
–all
-A
–almost-all
-h
–human-readable
-r
–reverse
-rw-r–r–
Access rights to the file. The first character indicates the type of file. Among the different types, a leading dash means a regular file, while a d indicates a directory. The next three characters are the access rights for the file’s owner, the next three are for members of the file1’s group, and the final three are for everyone else.
Rm
Remove files and directories
Ln
Create hard and symbolic links
Mkdir
Make directory
Cp
Copy files and directories
Mv
Move and rename files
Wc
Word Count
-l
Show lines
Tree
Shows you files in a tree format
> >
Add content into an existing file
>
Add content into a NEW file
Head/Tail
Show the x lines in that start or end of a file
Echo
Echo is a shell-builtin that performs a very simple task. It prints its text arguments on standard output.
echo “this is a test”
this is a test
~ tilde
When used at the beginning of a word, it expands into the name of the home directory of the named user or, if no user is named, the home directory of the current user.
What is a Parameter?
It’s a feature that is more useful in shell scripts than directly on the command line. Many of its capabilities have to do with the system’s ability to store small chunks of data and to give each chunk a name.
echo $USER
Me
What is an Escaping Character?
Sometimes we want to quote only a single character. To do this, we can precede a character with a backslash, which in this context is called the escape character. Often this is done inside double quotes to selectively prevent an expansion.
echo “The balance’ for user $USER is: $5.00”
The balance for user me is: $5.00
Chmod
To change the mode (permissions) of a file or directory, use the chmod command. Be aware that only the file’s owner or the superuser can change the mode of a file or directory.
Sed
Stream editor. Doesn’t change words, it changes regular expressions.
Less
Looks at a file in a list
Ping
A successful “ping” will indicate that the elements of the network (its interface cards, cabling, routing, and gateways) are in generally good working order.
Traceroute
The traceroute program lists all the “hops” network traffic takes to get from the local system to a specified host. For routers that provided identifying information, we see their hostnames, IP addresses, and performance data, which includes three samples of round-trip time from the local system to the router.
Ftp
Move files over network