Linuxathome.net - Linux news and help for home broadband internet users
 Home | Files | Case Mods | Reviews | Forum | Search | Links | RDF Feed | Contact
Sections

Installation Guide
Setting Up
Internet Sharing
Port Forwarding
Services Config
Installing Programs
Game Servers
Using IPTables
Useful Commands
Kernel Upgrading
System Recovery
Red Hat 7.2 Setup
OpenBSD Setup
BPA Login Setup
PPPoE Setup
Add New Hardware
Using PPTP VPN
VMware ESX Cmds
Our RC5 Team
Folding@Home
Help Support Us

 
Articles
Linux Security
NetStats FAQ
Linux KIS Trojan
CAT5/LAN Cables
Domain Names
Presario RH Install APC Debian DVD
 
Slashdot.org
  • Python Developer Survey: 55% Use Linux, 6% Use Python 2
  • 'Is It Ethical to Have Children in the Face of Climate Change?'
  • Tech Worker Builds Free AI-Powered Tool For Fighting US Health Insurance Denials
  • Oceanographers Mapping Underwater Mountain Find Flying Spaghetti Monster
  • Washington Post Calls Telegram 'a Haven for Free Speech - and Child Predators'
  • Inside Boeing's Factory Lapses That Led To the Alaska Air Blowout
  • Long Covid Knocked a Million Americans Off Their Career Paths
  • How Not To Hire a North Korean IT Spy
  • How a Group of Teenagers Pranked 'One Million Checkboxes'
  • Woman Mailed Herself an Apple AirTag To Help Catch Mail Thieves
  • Google Play Store Can Finally Update Multiple Apps At Once
  • Scientists Detect Invisible Electric Field Around Earth For First Time
  • US Government Opens Up 31 Million Acres of Federal Lands For Solar
  • Apple Stands By Decision To Terminate Account Belonging To WWDC Student Winner
  • Wells Fargo Worker Dies At Desk, Nobody Notices For Four Days
  •  
    Affiliates

    TweakTown.com
    ZGeek.com
    pebkac-consulting.com.au

      Linux Commands, Config Files and Useful System Folders

     

    The following commands, standard configuration files and system folders aim to give all variations of Linux users (from novice, intermediate to advanced) a reference point to assist with the setup, management and upgrades of any Linux system:

     

      Command List

     
    COMMAND
     
    DESCRIPTION
    man -k "<search string>"
    -
    Searches the man pages for the <search string specified>, good for when you don't 100% know what your looking for.
    ifconfig
    -
    This lists all the ethernet adapters and there details including the IP addresses and base addresses.
    ifup <eth#>
    -
    Bring an ethernet interface (eth#) up.
    ifdown <eth#>
    -
    Take an ethernet interface (eth#) down.
    rpm -ivh <filename.rpm>
    -
    Installs a program from an RPM package to its default install directory.
    rpm -u <filename.rpm>
    -
    Updates a program from an RPM package to its default install directory.
    mount -t iso9660 /dev/cdrom /mnt/cdrom
    -
    Mounts a CDROM drive in the ISO9660 format so that it can be accessed through /mnt/cdrom
    pump -h <hostname> -i eth0
    -
    This is a built in DHCP client program for Red Hat 6.2, it establishes and IP address from your <hostname> and assigns it to your ethernet interface eth0 so that you can connect to the net through your cable connection.
    gunzip <filename.gz>
    -
    Uncompresses an GZIP file so that it can either be used or untared.
    gzip <filename>
    -
    Compresses a tar file so it can be stored to transferred easily.
    tar -xvf <filename.tar>
    -
    This extracts all files and directories from a TAR compresses file into its default directory in your current working directory.
    tar -xzvf <filename.tar.gz>
    -
    Extras all the files from a tarball (a TAR file that is also GZIP'ed). This allows a single command to do both extractions.
    tar -cf <filename.tar> /<directory>/*
    -
    This will create a new TAR file with the name specified by <filename.tar> which will contain all the files in the <directory> and all sub-directories. (You can then GZIP it)
    samba {start|stop|restart|status}
    -
    This runs or stops the SAMBA service which allows Windows machines to see and browse your Linux computer.
    locate -u
    -
    This updates the locate database so that you can have up to date search information. Same as updatedb, must be run as root.
    locate <filename>
    -
    This will list all directories for which your search <filename> is located in.
    alias name="execute_string"
    -
    This aliases a command <name> to an executable string, e.g. alias cdrom="mount -t ......" would allow easy mounting of the CD-ROM drive by simply running the cdrom command.
    rm -rf <directory>
    -
    This removes a <directory> and all its contents without prompting for confirmation on each file (be careful with this).
    du -c -h
    -
    This calculates the total amount of disk space used up on your Linux box in human readable format, i.e. MB / GB etc.
    <command> > /dev/null
    -
    This executes a <command> and redirects all its output to the null device and hence displays nothing on the screen.
    <command> >> <filename>
    -
    This executes a command and redirects it to append to a file given by <filename>
    chmod <options> <filename/directory>
    -
    Changes the READ / WRITE / EXECUTE permissions of a file or directory based on USER / GROUP.
    chown <user> <filename/directory>
    -
    Similar to the above, but it changes the owner of the file to <user>.
    chgrp <group> <filename/directory>
    -
    Once again similar to above, changes the the group if of a file or directory to that of <group>.
    man <command>
    -
    Displays the manual entries for the given <command>, is very useful for finding out all the options of a command.
    <command1> | <command2>
    -
    This is the PIPE command and allows the output of the <command1> to become the input of <command2>.
    pwd
    -
    Lists the full directory path of your current working directory.
    passwd
    -
    Allows the current user to change their password.
    adduser <options>
    -
    Allows the root (superuser) to add another authorized user to the database of users for your Linux box. (/etc/passwd)
    groupadd <options>
    -
    Allows the root (superuser) to add another authorized group to the database of groups for your Linux box. (/etc/group)
    su
    -
    Prompts the current user for the superuser password, if correct they are given all root privileges. This is useful when logging into your server from a remote terminal as you can only login as root from the box itself.
    shutdown -h -t 30 now "message"
    -
    This sends the "message" out to all terminals and shuts down the box after 30 seconds from the time you hit enter, the -h means that it will halt otherwise you can select a reboot option, this is especially good if you have an ATX motherboard as it will auto power off once the system has halted.
    cat <filename> | more
    -
    This will display the contents of the file <filename> and then PIPE it to a command called more which will display it one screen at a time so you can read it easily.
    [TAB] Key
    -
    Command completion, The golden key it will work out what the rest of your command is from the options it has available.
    ls -al
    -
    Lists files for the current directory, showing permissions groups and owners.
    cp [source] [target]
    -
    Copy a file to another location, this can also be used to copy multiple files and directories at once.
    ps aux
    -
    Displays all current running processes and programs. This will include the system and other users processes.
    kill [-9] [processes id]
    -
    Kills specified processes, this is good for a program that you want to shut down immediately. Use -9 to force stubborn program to die..
    kill -1 -1
    -
    This will kill all of your tasks, good for if you have a Telnet session crash and processes are still running.
    killall <program name>
    -
    If you want to kill a program from a script then you will need this, it will find the appropriate PID and terminate the program.
    pidof <program name>
    -
    Can be used to find the PID of a certain program that is running on your machine.
    df
    -
    Calculates the amount of free disk space for all mounted drives on your system.
    ln -s <folder> <linked folder>
    -
    This creates a symbloic link from the <linked folder> to the <folder>, this means it you can use <linked folder> and it will really be <folder>.
    fsconf
    -
    Filesystem configuration utility (makes changes to the /etc/fstab file).
    lpdconfig
    -
    A print-spooling configuration utility.
    netconf
    -
    A TCP/IP services configuration utility.
    linuxconf
    -
    Comprehensive interface for administering your Red Hat system.
    userconf
    -
    User and Group configuration utility.
    xconf
    -
    X11 configuration utility.
    ntsysv
    -
    Used to configure what services are started at boot time.
    scp -r username@ip_address:path/to/* .
    -
    Secure copy (remote copy program). Uses SSH encryption to transfer files between systems (requires user account permisssions etc).
    find ./ -name <file_name>
    -
    If you can't use locate, then find is a more standardised Linux search program.
    dmesg
    -
    Print or control the kernel ring buffer, best way to monitor boot up messages by the Linux kernel and anylse to find problems etc
    lsmod
    -
    Shows the status of modules loaded with the Linux kernel (useful for seeing if your drivers (if modules) are loaded and working etc)
    modprobe
    -
    Program to add or remove modules from the Linux kernal (use this to add or remove your device drivers/modules).
    who
    -
    Lists who is currently logged into a Linux system, detailing username, connect method, date connected and IP address information.
    top
    -
    Provides a dynamic real-time view of a running system, use this as part of your system performance analysis.
    lsof
    -
    Lists all open files belonging to all active processes.
    vi
    -
    vi is a powerful text editing application that can be scripted, add modules and increase functionality, its a *must* for all Linux users.
    shred
    -
    Securely deletes a file by overwrite its contents
    arp
    -
    Manipulates the systems kernal ARTP cache, used mainly for clearing or updating the systems address mappings.
    head -n # <filename>
    -
    Output the first part of files, where the options such as -n are used it will display only # number of lines etc (man head for more info)
    tail -n # <filename>
    -
    Output the last part of files, where the options such as -n are used it will display only # number of lines etc (man tail for more info).
    nice
    -
    Runs a program with modified scheduling priority, i.e. a higher or lower priority to that of a normal process, guarantees more cpu time.
    nohup
    -
    Run a command immune to hangups, with output to a non-tty.
    stty
    -
    Change and print terminal line settings. Change the way your terminal sessions act or behaves to better suit you as a user.
    talk
    -
    Talk to another user currently logged in (doesn't matter which machine logged into as long as the usernames remain the same).
    !!
    -
    To automatically re-display the last command you typed at the prompt, type: !! and press enter.
    diff
    -
    Find the difference between two files, great for checking files (particularly code or configs) to see where they differ etc.
    screen
    -
    Allows you to run programs in a re-attachable virtual terminal.
    mc
    -
    Powerful filemanager that can browse rpm, tar, ftp, ssh, etc
    hwclock
    -
    Hardware Clock date/time, without arguments displays hardware date/time info, with --systohc will sync system to hardware
    chkconfig
    -
    Updates and queries runlevel information for system services 
    TOP
     
      Configuration Files
     
    CONFIG FILE
     
    DESCRIPTION
    /etc/lilo.conf
    -
    Configures LILO, the Linux boot manager.
    /etc/fstab
    -
    Configures automatically mounted file systems.
    /etc/smb.conf
    -
    Configures Samba, Windows file sharing.
    /etc/rc.d/rc.local
    -
    Add any extra startup commands and programs here. e.g. your IP forwarding script.
    /etc/rc.d/rc.#
    -
    Where # is a number 0 through to 6, When a system starts, the init command runs a rc.# for a particular runlevel.
    /etc/profile
    -
    System wide shell environment profile, edit this to change user environment information.
    /etc/cron.<frequency>
    -
    .hourly, .daily, .weekly, .monthly, Used to schedule automated task execution from within your Linux system environment.
    TOP
     
      Standard Linux Directories
     
    DIRECTORY
     
    DESCRIPTION
    /
    -
    The 'root' folder, this is the base of the Linux folder structure, all folders and files will appear logically below '/' even though they may be part of another file system, partition or even computer system (i.e. when mounted).
    /bin
    -
    Binaries folder
    /boot
    -
    System boot folder (usually a good idea to have it on a seperate 100MB or so parition) this is where your kernal boot image is stored.
    /dev
    -
    Devices folder, this where you will find information and gain access to all devices on your system (serial, floppy, ide, scsi etc)
    /etc
    -
    Used by most programs and Linux systems to store configuration (*.conf) files in a common area for maintainability and backups etc.
    /home
    -
    Home folders, all your users (except root) will have a home folder contained within this folder, also a good idea to put on a separate partition for systems with large user bases, this is to ensure user files don't compromise system stability by filling the drive.
    /lib
    -
    Libraries folder, used to store modules (.o files) and other similar files.
    /mnt
    -
    Mount folder, where you should mount any devices, any automatically mounted devices will show up in here.
    /proc
    -
    Process information, you can view live information on your entire system from this folder. e.g. /proc/cpuinfo, /proc/net/ etc
    /root
    -
    The root (or in Windows world 'Administrator') users home folder.
    /sbin
    -
    Should contain only binaries essential for booting, restoring, recovering, and/or repairing the system in addition to the binaries in /bin.
    /src
    -
    Source folder, a good idea to keep all your program source separate from other binaries for maintainability and convenience.
    /tmp
    -
    Temporary folder used by programs and users for storing non important runtime files that can be deleted when no longer in use.
    /usr
    -
    User program binaries, useful for separating user applications from the systems/admin application binaries (/bin).
    /var
    -
    Folder for storage of files that an be of variable size, i.e. your log files are usually stores in /var/log/appname. Good idea to separate again on another partition or physical disk to ensure that log file growth doesn't compromise system stability.
    TOP

     

    Proudly Hosted By:
    Hosted by PEBKAC Consulting

    Please read our Legal Notice for information concerning our site and its content.
    All logos and trademarks in this site are property of their respective owner. All the rest © 2000 - 2016 by Linuxathome.net

    Reviews

    D-Link DI-704P
    VIA EPIA-M 9000
    Tux Applique
    Ricoh MP5125A
    AMD XP 2600+
    3DProphet 9000Pro
    Radeon 9700 Pro
    XTNDAccess IrDA
    Netgear FS-524s
    DSR2161 KVM
    Game TheaterXP & XPS-510 Speakers
    3D Prophet 4000XT
    AutoView 400
    Back-UPS CS 350
    Dual Neon Kit
    SwitchView KVM
    20x4 LCD Kit
    Window Kit

     
    LinuxSecurity
  • 5 Open-Source Blockchain Technologies That Linux Users Need to Know About
  • The Three Best Tools You Need to Scan Your Linux System for Malware
  • Navigating the Linux Kernel's Latest DMA Security Vulnerability
  • Staying a Step Ahead of Adversaries: Mitigating Chromium's Security Flaws on Linux
  • Slackware: 2024-244-01: libpcap Security Advisory Update
  • Fedora 40: microcode_ctl 2024-5c5c384fa7 Security Advisory Updates
  • Fedora 40: python3.11 2024-985017d277 Security Advisory Updates
  • Fedora 40: xen 2024-91ddad6c8b Security Advisory Updates
  • Fedora 39: xen 2024-ed546e3543 Security Advisory Updates
  • Debian: DSA-5762-1: webkit2gtk Security Advisory Updates
  •  
    Google Search
    Enter Keywords:

     
    Bash Jokes

    % [Where is Jimmy Hoffa?

    Missing ].

     
    Virtualization, Virtual Machine & Virtual Server Consolidation - VMware

    The Community ENTerprise Operating System

    Get Slackware Linux

    Use OpenOffice.org

    Use Asterisk