test1 Flashcards
o uname
system type
o hostname
host name
o whoami
current login
o date
shows current date AND time. The time function does not show time. You use date
o chfn
used to change system details
o passwd
used to change your password
o man
used to get help with Linux commands. Format usage: man {command_name}
o ls
lists the directory of files. (All commands are case sensitive!!)
ls – l
gives expanded information about files, including security
ls -F
provides hints about the type of file
ls -lF
provides expanded information about files and directories, as well as info on the types of files
o cd
command used to move around
.
is current directory
..
is the directory above the current
~
represents the user’s home directory
o mkdir
creates a directory
o rmdir
removes directory (has to be empty first)
o cp
to copy files
o rm
to remove files
o mv
to move files (combines the cp and rm commands)
r
read
w
write
x
execute
o chmod
to change file rights
chmod g=u
groups get same rights as user
o find
used to fine a file on the system
locate
an alternate command to find. Faster than the find command.
o cat
displays content of a file
o pipline command (vertical bar) pipe character
redirects the output of one command into the input of another command
o less and more
used to displays output by screen. “Less” has more capabilities then “More”.
cat (file name) | more
cat (file name) | less
o grep
used to find a specific word
o write
sends message to user
o wall
sends message to everyone
o sudo
– runs a program once. Allows a user with proper permissions to execute a command as another user.
o su
to become root or switch to another user
o who
displays the users that are currently logged into your Unix computer system
o w
provides a quick summary of every user logged into a computer, what each user is currently doing, and what load all the activity is imposing on the computer itself.
o Uptime
The current time, how long the system has been running, how many users are currently logged on, and the system load averages for the past 1, 5, and 15 minutes.
o last
prints the entries of successful login attempts made by the users in the past.
o ps
(Process Status) provides information about the currently running processes, including their process identification numbers
o kill
terminates processes based on Process ID numbers PID
o killall
kill commands to stop all processes
o df
used to display the amount of available disk space
o ifconfig
displays the configuration of all active interfaces. Same as ipconfig in windows. Stands for interface configuration. Will provide info on each interface, such as the inet (IP address), subnet mask, etc.
o netstat
displays network connections for the Transmission Control Protocol, routing tables, and a number of network interface and network protocol statistics. Used for monitoring incoming and outgoing network connections.
ARP Cache
: Essentially a database of IP addresses and their related MAC addresses for devices on the LAN. This is used to send packets between devices on the LAN. You must send an ARP request to computer you want to communicate with and it looks for the IP address for the desired device in the cache and then sends over the MAC address, so you can communicate, this is then added to the ARP cache.
Netstat
Displays active TCP connections. This also includes IPv4 and IPv6 addresses, as well as local and foreign address. Lastly it shows the state of each connection.
Netstat -na
It displays all active TCP connections and the TCP and UDP ports on which the computer is listening. The addresses and port numbers are expressed numnerically, without the names, due to using the “-n” command, which displays things numerically
Ipconfig
– Provides information on all adapters and their media state. It also provides IP address, Subnet mask, and default gateway for each adapter. IP addresses listed in both IPV4 and IPV6.
Ipconfig /all
Displays the full TCP/IP configuration for all adapters. Adapters can represent physical interfaces or logical interfaces. Provides host name, physical MAC address, IP, Subnet Mask, whether or not DHCP is enabled, and if autoconfiguration is enabled for devices and adapters.
Tracert
traceroute sends ICMP echo requests instead of UDP packets. The time-to-live (TTL) value, also known as hop limit, is used in determining the intermediate routers being traversed towards the destination.
Ping
sends out an echo request to specific IP address and receives echo replies in return. The replies show that a destination is reachable. You can ping a certain address with a certain amount of data and it will show the number of packets sent, received, and lost. This also shows the RTT or round trip time to do this. It also shows the number of packets sent, received, and lost.
What is the format of general Linux commands
Command {-options}{Parameters}
What does an option start with?
options start with dashes (-)
Can there be multiple parameters and options?
Yes there can be
>
Creates a file. Ex. cat >passwords. Creates a file called “passwords”. Can also be used to redirect current files into new files. Ex. cat (current file) > (new file)
> >
Using the standard output with a redirection operator. This would append a current file to the END of another existing file. EX. cat file1»_space; file2 . This appended the data from file1 to the end of file2.
pwd
Stands for “print working directory”. Reports the full path to the current directory. The full path for any directory always begins with a forward slash (/). Almost always used by itself but can also have options. pwd [option]
netstat -a
lists all the listening ports of TCP and UDP connections. Shows the state of the port (listening, etc.)
-v
version number
-h
help