Sei sulla pagina 1di 3

Linux Boot and File Systems

--------------------------------------------------------------------------------
Installation log file
/root/install.log Records actions that occurred or failed during the installatio
n process
/root/install.log.syslog Lists all of the system events that occurred during the
installation such as the creation of user and group accounts
proc directory lists system information made available by the kernel
ls -F /proc Files found in /proc directory
cat /proc/cpuinfo to view information that has been detected about the CPU
cat /proc/meminfo to view information about the RAM on the computer
cat /proc/dma to view IRQs, DMAs, I/O data
cat /proc/modules lists devices inserted into the kernel as modules
dmesg | tail Displays hardware detected at last boot
tail /var/log/boot.log to view system processes successful and not
to find kernel version number: type uname -r
Getting Help
Enter man whoami to get the manual page for the whoami command (press Control+Z
to get out of the man page)
Some commands have the same name for different functions
e.g. man printf returns the manual for the printf command in section 1
e.g. man 3 printf returns the manual for the printf library routine (No entry fo
r printf in section 3 of the manual)
man -k who to locate all the commands that have 'who' in their name or descripti
on (man -k is similar to apropos)
apropos who also finds all the commands that have 'who' in their name or descrip
tion ( searches /usr/bin/whatis)
info whoami to get Info page on the whoami command
help echo to get help on the echo command
System Shutdown
Linux needs to shutdown properly and not just turned off
shutdown command is used to shutdown or reboot
it sends broadcast messages to all terminals of the impending shutdow
shutdown -h +15 halts the system in 15 minutes with the following message: The s
ystem is going DOWN for system halt in 15 minutes !!
Press Control + C to stop the shutdown command from happening
You can also log in as another user and type shutdown -c to cancel shutdown
Only an administrator account can issue the shutdown command
shutdown -h now to shutdown now
shutdown -r now to reboot
-h to halt, -r to reboot
shutdown -k now issues the warning but it does not issue the shutdown command (s
trange!)
shutdown -h +15 Please save your work and log off shutdown with message
Home Directories
When you login, you are automatically placed in your user home folder (e.g. /hom
e/ron)
User home folders are created automatically with the user creation
Only that user or the root account can have access to the account
pwd command can tell you which folder you are in
The root user's home account is located in /root
Navigating the Filesystem
cd /home/ron changes directory to /home/ron
cd without an argument returns you to your home directory
cd ~ changes to current user's home directory
cd / changes to the root folder
cd ~ron changes to ron's home directory in /home/ron
absolute pathname is the path to a folder starting from the / root
relative pathname is the path to a folder starting from the current folder
cd temp changes to the temp folder under the current folder
cd .. changes to the parent of the current folder
cd ../bob changes to the bob folder located in the parent's folder
cd ../.. changes to the parent of your parent's folder
Using Tab to Complete an Entry
cd /h plus the Tab Key takes you to the /home folder if there are no other folde
rs that start with an h in the / root.
cd /home/r plus the Tab Key takes you to /home/ron folder
cd /r plus the Tab Key takes you to the /root folder
Listing Files
ls command to list the files in the current folder
ls /home/ron lists the files in the /home/ron folder
dir command is a pointer to the ls command
ls -F to view files and their types with the following suffixes
@ indicates a linked file
* indicates an executable file
/ indicates a subdirectory
= indicates a socket
| indicates a named pipe
files without these characters could be text, binary or special device files
ls -l provides a long list of files with more information including permissions
the first character of each line could be one of the following:
d is a directory
l is a symbolically linked file
b or c is a special device file
n is a named pipe
s is a socket
- is all other files such as text, or binary data files
ll command is sometimes supported as a substitute for ls -l
hidden filenames start with a period
ls -a is the command to view hidden files
Text files
text files can be text files, configuration files or shell scripts
cat is the command to view the entire contents of a text file on the screen
cat unit13.html displays the contents of the unit13.html file
cat -n unit13.html displays the line number of each line of the unit13.html file
tac readme is the command to display the file readme in reverse order. Useful f
or log files
head is the command to display only the beginning of a file
head readme displays the first ten lines of the readme file
head -3 readme displays the first 3 lines of the readme file
tail is the command to display only the bottom of a file
tail readme displays the last ten lines of the readme file
tail -8 readme displays from line 8 to the end of the file
more is the command to display an output one page at a time
more readme displays one page at a time of the readme file
press enter to display the next line
press spacebar to display the next page
less is also a command to display an output one page at a time
less readme displays one page at a time of the readme file
less is an improvement of the more command with more features
ls | less takes the screen output of the ls command as input to less
Binary Files
use cat, tac, head, tail commands only on text files
strings is the command to view text strings inside a binary file
strings /bin/echo displays the string portions of the echo command
cat /bin/echo might cause your prompt to change to unreadable characters --- do
not use it
od /bin/echo is the command to view the binary file /bin/echo in octal format

Potrebbero piacerti anche