SlideShare a Scribd company logo
1 of 2
Download to read offline
THE ONE PAGE LINUX MANUAL
                                      A summary of useful Linux commands
 Version 3.0                                             May 1999                          squadron@powerup.com.au

                                                                         rm name                        Remove a file or directory called
Starting & Stopping                                                                                     name
                                                                         rm -rf name                    Kill off an entire directory and all it’s
                                                                                                        includes files and subdirectories
 shutdown -h now          Shutdown the system now and do not
                          reboot                                         cp filename                    Copy the file called filename to the
 halt                     Stop all processes - same as above             /home/dirname                  /home/dirname directory

 shutdown -r 5            Shutdown the system in 5 minutes and
                          reboot                                         mv filename                    Move the file called filename to the
                                                                         /home/dirname                  /home/dirname directory
 shutdown -r now          Shutdown the system now and reboot
 reboot                   Stop all processes and then reboot - same
                          as above                                       cat filetoview                 Display the file called filetoview
 startx                   Start the X system                             man -k keyword                 Display man pages containing
                                                                                                        keyword
                                                                         more filetoview                Display the file called filetoview one
Accessing & mounting file systems                                                                       page at a time, proceed to next page
                                                                                                        using the spacebar
 mount -t iso9660 /dev/cdrom              Mount the device cdrom         head filetoview                Display the first 10 lines of the file
 /mnt/cdrom                               and call it cdrom under the                                   called filetoview
                                          /mnt directory
                                                                         head -20 filetoview            Display the first 20 lines of the file
 mount -t msdos /dev/hdd                  Mount hard disk “d” as a                                      called filetoview
 /mnt/ddrive                              msdos file system and call
                                          it ddrive under the /mnt       tail filetoview                Display the last 10 lines of the file
                                          directory                                                     called filetoview

 mount -t vfat /dev/hda1                  Mount hard disk “a” as a       tail -20 filetoview            Display the last 20 lines of the file
                                          VFAT file system and call it                                  called filetoview
 /mnt/cdrive
                                          cdrive under the /mnt
                                          directory                      Installing software for Linux
 umount /mnt/cdrom                        Unmount the cdrom
                                                                         rpm -ihv name.rpm               Install the rpm package called name
Finding files and text within files                                      rpm -Uhv name.rpm               Upgrade the rpm package called
                                                                                                         name
 find / -name fname          Starting with the root directory, look
                                                                         rpm -e package                  Delete the rpm package called
                             for the file called fname                                                   package
 find / -name ”*fname*”      Starting with the root directory, look
                                                                         rpm -l package                  List the files in the package called
                             for the file containing the string fname                                    package
 locate missingfilename      Find a file called missingfilename
                                                                         rpm -ql package                 List the files and state the installed
                             using the locate command - this                                             version of the package called
                             assumes you have already used the                                           package
                             command updatedb (see next)
                                                                         rpm -i --force package          Reinstall the rpm package called
 updatedb                    Create or update the database of files                                      name having deleted parts of it (not
                             on all file systems attached to the linux                                   deleting using rpm -e)
                             root directory
                                                                         tar -zxvf archive.tar.gz or     Decompress the files contained in
 which missingfilename       Show the subdirectory containing the        tar -zxvf archive.tgz           the zipped and tarred archive called
                             executable file called missingfilename                                      archive
 grep textstringtofind       Starting with the directory called dir ,    ./configure                     Execute the script preparing the
 /dir                        look for and list all files containing                                      installed files for compiling
                             textstringtofind

The X Window System                                                      User Administration
                                                                         adduser accountname           Create a new user call accountname
 xvidtune                Run the X graphics tuning utility
                                                                         passwd accountname            Give accountname a new password
 XF86Setup               Run the X configuration menu with
                         automatic probing of graphics cards             su                            Log in as superuser from current login
 Xconfigurator           Run another X configuration menu with           exit                          Stop being superuser and revert to
                         automatic probing of graphics cards                                           normal user
 xf86config              Run a text based X configuration menu

Moving, copying, deleting & viewing files                                Little known tips and tricks
                                                                         ifconfig                       List ip addresses for all devices on
 ls -l                         List files in current directory using
                               long format                                                              the machine
 ls -F                         List files in current directory and       apropos subject                List manual pages for subject
                               indicate the file type                    usermount                      Executes graphical application for
 ls -laC                       List all files in current directory in                                   mounting and unmounting file
                               long format and display in columns                                       systems
/sbin/e2fsck hda5            Execute the filesystem check utility
                             on partition hda5
                                                                            File permissions
fdformat /dev/fd0H1440       Format the floppy disk in device fd0
tar -cMf /dev/fd0            Backup the contents of the current
                             directory and subdirectories to
                             multiple floppy disks
tail -f /var/log/messages    Display the last 10 lines of the system
                             log.
cat /var/log/dmesg           Display the file containing the boot
                             time messages - useful for locating
                             problems. Alternatively, use the
                             dmesg command.
*                            wildcard - represents everything. eg.
                             cp from/* to will copy all files in the
                             from directory to the to directory
?                            Single character wildcard. eg.
                             cp config.? /configs will copy all files
                             beginning with the name config. in
                             the current directory to the directory         If the command ls -l is given, a long list of file names is
                             named configs.                                 displayed. The first column in this list details the permissions
                                                                            applying to the file. If a permission is missing for a owner,
[xyz]                        Choice of character wildcards. eg.
                                                                            group of other, it is represented by - eg. drwxr-x—x
                             ls [xyz]* will list all files in the current
                             directory starting with the letter x, y,       Read = 4                     File permissions are altered by giving the
                             or z.                                          Write = 2                    chmod command and the appropriate
                                                                                                         octal code for each user type. eg
linux single                 At the lilo prompt, start in single user       Execute = 1
                             mode. This is useful if you have                                            chmod 7 6 4 filename will make the file
                             forgotten your password. Boot in                                            called filename R+W+X for the owner,
                             single user mode, then run the                                              R+W for the group and R for others.
                             passwd command.                                chmod 7 5 5                  Full permission for the owner, read and
ps                           List current processes                                                      execute access for the group and others.
kill 123                     Kill a specific process eg. kill 123           chmod +x filename            Make the file called filename executable
                                                                                                         to all users.

Configuration files and what they do                                        X Shortcuts - (mainly for Redhat)
/etc/profile             System wide environment variables for
                         all users.                                         Control|Alt + or -                      Increase or decrease the screen
                                                                                                                    resolution. eg. from 640x480 to
/etc/fstab               List of devices and their associated mount                                                 800x600
                         points. Edit this file to add cdroms, DOS
                         partitions and floppy drives at startup.           Alt | escape                            Display list of active windows
/etc/motd                Message of the day broadcast to all users          Shift|Control F8                        Resize the selected window
                         at login.                                          Right click on desktop                  Display menu
etc/rc.d/rc.local        Bash script that is executed at the end of         background
                         login process. Similar to autoexec.bat in          Shift|Control Altr                      Refresh the screen
                         DOS.                                               Shift|Control Altx                      Start an xterm session
/etc/HOSTNAME            Conatins full hostname including domain.
/etc/cron.*              There are 4 directories that automatically         Printing
                         execute all scripts within the directory at
                         intervals of hour, day, week or month.
                                                                            /etc/rc.d/init.d/lpd start      Start the print daemon
/etc/hosts               A list of all know host names and IP
                         addresses on the machine.                          /etc/rc.d/init.d/lpd stop       Stop the print daemon
/etc/httpd/conf          Paramters for the Apache web server                /etc/rc.d/init.d/lpd            Display status of the print daemon
                                                                            status
/etc/inittab             Specifies the run level that the machine
                         should boot into.                                  lpq                             Display jobs in print queue
/etc/resolv.conf         Defines IP addresses of DNS servers.               lprm                            Remove jobs from queue
/etc/smb.conf            Config file for the SAMBA server. Allows           lpr                             Print a file
                         file and print sharing with Microsoft              lpc                             Printer control tool
                         clients.                                           man subject | lpr               Print the manual page called subject
~/.Xdefaults             Define configuration for some X-                                                   as plain text
                         applications. ~ refers to user’s home              man -t subject | lpr            Print the manual page called subject
                         directory.                                                                         as Postscript output
/etc/X11/XF86Confi       Config file for X-Windows.                         printtool                       Start X printer setup interface
g
~/.xinitrc               Defines the windows manager loaded by
                         X. ~ refers to user’s home directory.




                                                                                                 Get your own Official Linux Pocket Protector - includes
                                                                                                           handy command summary. Visit:
                                                                                                           www.powerup.com.au/~squadron

More Related Content

What's hot

Unix command
Unix commandUnix command
Unix command
Atul Pant
 
Applecmdlista zs
Applecmdlista zsApplecmdlista zs
Applecmdlista zs
Ben Pope
 
Building a linux kernel
Building a linux kernelBuilding a linux kernel
Building a linux kernel
Raghu nath
 
Compression
CompressionCompression
Compression
aswathyu
 

What's hot (18)

basic-unix.pdf
basic-unix.pdfbasic-unix.pdf
basic-unix.pdf
 
Linux
LinuxLinux
Linux
 
package mangement
package mangementpackage mangement
package mangement
 
Linux
LinuxLinux
Linux
 
1.2 boot the system v2
1.2 boot the system v21.2 boot the system v2
1.2 boot the system v2
 
4.1 create partitions and filesystems
4.1 create partitions and filesystems4.1 create partitions and filesystems
4.1 create partitions and filesystems
 
Unix command
Unix commandUnix command
Unix command
 
Applecmdlista zs
Applecmdlista zsApplecmdlista zs
Applecmdlista zs
 
Introduction to linux day-3
Introduction to linux day-3Introduction to linux day-3
Introduction to linux day-3
 
Linux cheat-sheet
Linux cheat-sheetLinux cheat-sheet
Linux cheat-sheet
 
Yum (Linux)
Yum (Linux) Yum (Linux)
Yum (Linux)
 
Command Line Tools
Command Line ToolsCommand Line Tools
Command Line Tools
 
Building a linux kernel
Building a linux kernelBuilding a linux kernel
Building a linux kernel
 
Linux basic commands
Linux basic commandsLinux basic commands
Linux basic commands
 
Compression
CompressionCompression
Compression
 
Unix reference sheet
Unix reference sheetUnix reference sheet
Unix reference sheet
 
Linux Bash Shell Cheat Sheet for Beginners
Linux Bash Shell Cheat Sheet for BeginnersLinux Bash Shell Cheat Sheet for Beginners
Linux Bash Shell Cheat Sheet for Beginners
 
Linux Commands
Linux CommandsLinux Commands
Linux Commands
 

Viewers also liked (10)

Gnu study guide linux admin 1 (lab work lpi 101) v 0.2
 Gnu study guide linux admin 1 (lab work lpi 101) v 0.2 Gnu study guide linux admin 1 (lab work lpi 101) v 0.2
Gnu study guide linux admin 1 (lab work lpi 101) v 0.2
 
101 2.1 design hard disk layout
101 2.1 design hard disk layout101 2.1 design hard disk layout
101 2.1 design hard disk layout
 
Full lab lpi
Full lab lpiFull lab lpi
Full lab lpi
 
Introduction to Linux
Introduction to Linux Introduction to Linux
Introduction to Linux
 
7 linux fdisk command examples to manage hard disk partition
7 linux fdisk command examples to manage hard disk partition7 linux fdisk command examples to manage hard disk partition
7 linux fdisk command examples to manage hard disk partition
 
Arch linux
Arch linuxArch linux
Arch linux
 
Red Hat Training
Red Hat   TrainingRed Hat   Training
Red Hat Training
 
System administration guide
System administration guideSystem administration guide
System administration guide
 
Linux Booting Steps
Linux Booting StepsLinux Booting Steps
Linux Booting Steps
 
UNIX/Linux training
UNIX/Linux trainingUNIX/Linux training
UNIX/Linux training
 

Similar to The one page linux manual

The one page linux manual
The one page linux manualThe one page linux manual
The one page linux manual
Craig Cannon
 
Basic linux commands
Basic linux commandsBasic linux commands
Basic linux commands
Nguyen Vinh
 
8.1.intro unix
8.1.intro unix8.1.intro unix
8.1.intro unix
southees
 
An Introduction to Linux
An Introduction to LinuxAn Introduction to Linux
An Introduction to Linux
Dimas Prasetyo
 

Similar to The one page linux manual (20)

The one page linux manual
The one page linux manualThe one page linux manual
The one page linux manual
 
The one page linux manual
The one page linux manualThe one page linux manual
The one page linux manual
 
Sahul
SahulSahul
Sahul
 
Termux commands-list
Termux commands-listTermux commands-list
Termux commands-list
 
Linux shell scripting
Linux shell scriptingLinux shell scripting
Linux shell scripting
 
Basic linux commands
Basic linux commandsBasic linux commands
Basic linux commands
 
Common linux ubuntu commands overview
Common linux  ubuntu commands overviewCommon linux  ubuntu commands overview
Common linux ubuntu commands overview
 
Linux ppt
Linux pptLinux ppt
Linux ppt
 
Directories description
Directories descriptionDirectories description
Directories description
 
Unix Basics For Testers
Unix Basics For TestersUnix Basics For Testers
Unix Basics For Testers
 
3.1.a linux commands reference
3.1.a linux commands reference3.1.a linux commands reference
3.1.a linux commands reference
 
Linux
Linux Linux
Linux
 
The Linux Command Cheat Sheet
The Linux Command Cheat SheetThe Linux Command Cheat Sheet
The Linux Command Cheat Sheet
 
Linux Presentation
Linux PresentationLinux Presentation
Linux Presentation
 
14.Linux Command
14.Linux Command14.Linux Command
14.Linux Command
 
8.1.intro unix
8.1.intro unix8.1.intro unix
8.1.intro unix
 
Linux ppt
Linux pptLinux ppt
Linux ppt
 
Introduction to linux day1
Introduction to linux day1Introduction to linux day1
Introduction to linux day1
 
An Introduction to Linux
An Introduction to LinuxAn Introduction to Linux
An Introduction to Linux
 
Basics of Linux
Basics of LinuxBasics of Linux
Basics of Linux
 

More from FitBlar Mit

Predikcija volitev 2011
Predikcija volitev 2011Predikcija volitev 2011
Predikcija volitev 2011
FitBlar Mit
 
Cafeteando con wendy
Cafeteando con wendyCafeteando con wendy
Cafeteando con wendy
FitBlar Mit
 
Jeison y el cafe
Jeison y el cafeJeison y el cafe
Jeison y el cafe
FitBlar Mit
 
Jeison y el cafe
Jeison y el cafeJeison y el cafe
Jeison y el cafe
FitBlar Mit
 
Jeison y el cafe
Jeison y el cafeJeison y el cafe
Jeison y el cafe
FitBlar Mit
 
Jeison y el cafe
Jeison y el cafeJeison y el cafe
Jeison y el cafe
FitBlar Mit
 
Jhan carlos quiroga peña
Jhan carlos quiroga peñaJhan carlos quiroga peña
Jhan carlos quiroga peña
FitBlar Mit
 
Jhan carlos quiroga peña
Jhan carlos quiroga peñaJhan carlos quiroga peña
Jhan carlos quiroga peña
FitBlar Mit
 
Kafeteando con karen
Kafeteando con karenKafeteando con karen
Kafeteando con karen
FitBlar Mit
 
kafeteando con karen
kafeteando con karenkafeteando con karen
kafeteando con karen
FitBlar Mit
 
kafeteando con karen
kafeteando con karenkafeteando con karen
kafeteando con karen
FitBlar Mit
 
Arte con café colombiano
Arte con café colombianoArte con café colombiano
Arte con café colombiano
FitBlar Mit
 
Expocicion del proyecto
Expocicion del proyectoExpocicion del proyecto
Expocicion del proyecto
FitBlar Mit
 

More from FitBlar Mit (20)

Predikcija volitev 2011
Predikcija volitev 2011Predikcija volitev 2011
Predikcija volitev 2011
 
Loreniiitha
LoreniiithaLoreniiitha
Loreniiitha
 
Natalia
NataliaNatalia
Natalia
 
Cafeteando con wendy
Cafeteando con wendyCafeteando con wendy
Cafeteando con wendy
 
Jeison y el cafe
Jeison y el cafeJeison y el cafe
Jeison y el cafe
 
Jeison y el cafe
Jeison y el cafeJeison y el cafe
Jeison y el cafe
 
Jeison y el cafe
Jeison y el cafeJeison y el cafe
Jeison y el cafe
 
Jeison y el cafe
Jeison y el cafeJeison y el cafe
Jeison y el cafe
 
Jhan carlos quiroga peña
Jhan carlos quiroga peñaJhan carlos quiroga peña
Jhan carlos quiroga peña
 
Arte del cafe
Arte del cafeArte del cafe
Arte del cafe
 
Jhan carlos quiroga peña
Jhan carlos quiroga peñaJhan carlos quiroga peña
Jhan carlos quiroga peña
 
Arte del cafe
Arte del cafeArte del cafe
Arte del cafe
 
Kafeteando con karen
Kafeteando con karenKafeteando con karen
Kafeteando con karen
 
Arte del cafe
Arte del cafeArte del cafe
Arte del cafe
 
kafeteando con karen
kafeteando con karenkafeteando con karen
kafeteando con karen
 
kafeteando con karen
kafeteando con karenkafeteando con karen
kafeteando con karen
 
Arte con café colombiano
Arte con café colombianoArte con café colombiano
Arte con café colombiano
 
Arte del cafe
Arte del cafeArte del cafe
Arte del cafe
 
Expocicion del proyecto
Expocicion del proyectoExpocicion del proyecto
Expocicion del proyecto
 
Arte del cafe
Arte del cafeArte del cafe
Arte del cafe
 

Recently uploaded

Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Victor Rentea
 

Recently uploaded (20)

Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 

The one page linux manual

  • 1. THE ONE PAGE LINUX MANUAL A summary of useful Linux commands Version 3.0 May 1999 squadron@powerup.com.au rm name Remove a file or directory called Starting & Stopping name rm -rf name Kill off an entire directory and all it’s includes files and subdirectories shutdown -h now Shutdown the system now and do not reboot cp filename Copy the file called filename to the halt Stop all processes - same as above /home/dirname /home/dirname directory shutdown -r 5 Shutdown the system in 5 minutes and reboot mv filename Move the file called filename to the /home/dirname /home/dirname directory shutdown -r now Shutdown the system now and reboot reboot Stop all processes and then reboot - same as above cat filetoview Display the file called filetoview startx Start the X system man -k keyword Display man pages containing keyword more filetoview Display the file called filetoview one Accessing & mounting file systems page at a time, proceed to next page using the spacebar mount -t iso9660 /dev/cdrom Mount the device cdrom head filetoview Display the first 10 lines of the file /mnt/cdrom and call it cdrom under the called filetoview /mnt directory head -20 filetoview Display the first 20 lines of the file mount -t msdos /dev/hdd Mount hard disk “d” as a called filetoview /mnt/ddrive msdos file system and call it ddrive under the /mnt tail filetoview Display the last 10 lines of the file directory called filetoview mount -t vfat /dev/hda1 Mount hard disk “a” as a tail -20 filetoview Display the last 20 lines of the file VFAT file system and call it called filetoview /mnt/cdrive cdrive under the /mnt directory Installing software for Linux umount /mnt/cdrom Unmount the cdrom rpm -ihv name.rpm Install the rpm package called name Finding files and text within files rpm -Uhv name.rpm Upgrade the rpm package called name find / -name fname Starting with the root directory, look rpm -e package Delete the rpm package called for the file called fname package find / -name ”*fname*” Starting with the root directory, look rpm -l package List the files in the package called for the file containing the string fname package locate missingfilename Find a file called missingfilename rpm -ql package List the files and state the installed using the locate command - this version of the package called assumes you have already used the package command updatedb (see next) rpm -i --force package Reinstall the rpm package called updatedb Create or update the database of files name having deleted parts of it (not on all file systems attached to the linux deleting using rpm -e) root directory tar -zxvf archive.tar.gz or Decompress the files contained in which missingfilename Show the subdirectory containing the tar -zxvf archive.tgz the zipped and tarred archive called executable file called missingfilename archive grep textstringtofind Starting with the directory called dir , ./configure Execute the script preparing the /dir look for and list all files containing installed files for compiling textstringtofind The X Window System User Administration adduser accountname Create a new user call accountname xvidtune Run the X graphics tuning utility passwd accountname Give accountname a new password XF86Setup Run the X configuration menu with automatic probing of graphics cards su Log in as superuser from current login Xconfigurator Run another X configuration menu with exit Stop being superuser and revert to automatic probing of graphics cards normal user xf86config Run a text based X configuration menu Moving, copying, deleting & viewing files Little known tips and tricks ifconfig List ip addresses for all devices on ls -l List files in current directory using long format the machine ls -F List files in current directory and apropos subject List manual pages for subject indicate the file type usermount Executes graphical application for ls -laC List all files in current directory in mounting and unmounting file long format and display in columns systems
  • 2. /sbin/e2fsck hda5 Execute the filesystem check utility on partition hda5 File permissions fdformat /dev/fd0H1440 Format the floppy disk in device fd0 tar -cMf /dev/fd0 Backup the contents of the current directory and subdirectories to multiple floppy disks tail -f /var/log/messages Display the last 10 lines of the system log. cat /var/log/dmesg Display the file containing the boot time messages - useful for locating problems. Alternatively, use the dmesg command. * wildcard - represents everything. eg. cp from/* to will copy all files in the from directory to the to directory ? Single character wildcard. eg. cp config.? /configs will copy all files beginning with the name config. in the current directory to the directory If the command ls -l is given, a long list of file names is named configs. displayed. The first column in this list details the permissions applying to the file. If a permission is missing for a owner, [xyz] Choice of character wildcards. eg. group of other, it is represented by - eg. drwxr-x—x ls [xyz]* will list all files in the current directory starting with the letter x, y, Read = 4 File permissions are altered by giving the or z. Write = 2 chmod command and the appropriate octal code for each user type. eg linux single At the lilo prompt, start in single user Execute = 1 mode. This is useful if you have chmod 7 6 4 filename will make the file forgotten your password. Boot in called filename R+W+X for the owner, single user mode, then run the R+W for the group and R for others. passwd command. chmod 7 5 5 Full permission for the owner, read and ps List current processes execute access for the group and others. kill 123 Kill a specific process eg. kill 123 chmod +x filename Make the file called filename executable to all users. Configuration files and what they do X Shortcuts - (mainly for Redhat) /etc/profile System wide environment variables for all users. Control|Alt + or - Increase or decrease the screen resolution. eg. from 640x480 to /etc/fstab List of devices and their associated mount 800x600 points. Edit this file to add cdroms, DOS partitions and floppy drives at startup. Alt | escape Display list of active windows /etc/motd Message of the day broadcast to all users Shift|Control F8 Resize the selected window at login. Right click on desktop Display menu etc/rc.d/rc.local Bash script that is executed at the end of background login process. Similar to autoexec.bat in Shift|Control Altr Refresh the screen DOS. Shift|Control Altx Start an xterm session /etc/HOSTNAME Conatins full hostname including domain. /etc/cron.* There are 4 directories that automatically Printing execute all scripts within the directory at intervals of hour, day, week or month. /etc/rc.d/init.d/lpd start Start the print daemon /etc/hosts A list of all know host names and IP addresses on the machine. /etc/rc.d/init.d/lpd stop Stop the print daemon /etc/httpd/conf Paramters for the Apache web server /etc/rc.d/init.d/lpd Display status of the print daemon status /etc/inittab Specifies the run level that the machine should boot into. lpq Display jobs in print queue /etc/resolv.conf Defines IP addresses of DNS servers. lprm Remove jobs from queue /etc/smb.conf Config file for the SAMBA server. Allows lpr Print a file file and print sharing with Microsoft lpc Printer control tool clients. man subject | lpr Print the manual page called subject ~/.Xdefaults Define configuration for some X- as plain text applications. ~ refers to user’s home man -t subject | lpr Print the manual page called subject directory. as Postscript output /etc/X11/XF86Confi Config file for X-Windows. printtool Start X printer setup interface g ~/.xinitrc Defines the windows manager loaded by X. ~ refers to user’s home directory. Get your own Official Linux Pocket Protector - includes handy command summary. Visit: www.powerup.com.au/~squadron