• Embed Doc
  • Readcast
  • Collections
  • CommentGo Back
Download
 
cd to change directories Type cd followed by the name of a directory to accessthat directory.Keep in mind that you are always in a directory and allowed access to anydirectories hierarchically above or below. Ex:cd gamesIf the directory games is not located hierarchically below the current directory,then the complete path must be written out. Ex:cd /usr/gamesTo move up one directory, use the shortcut command. Ex:cd ..Use clear to clear the command prompt Type clear to clean up your command promptwindow.This is especially helpful when you are typing lots of commands and need a cleanwindow to help you focus.Ex:clearThis is also useful when you are getting ready to type a rather long command anddo not wish to become confused by other details on the screen.Use date to set your server's date and time Type date followed by the two digitmonth, the two digit date, the two digit time, and two digit minutes. The syntaxis easy enough and resembles this: MMDDhhmmThis command is helpful but must be used when superuser or logged in as root.Otherwise you will get an "Operation not permitted" reply.As root user you can usethe command such as:date 11081300The above command will set the server date and time to the 11th month (November),the 8th day, at 1:00pm.Use df to check disk space Typing df provides a very quick check of your filesystem disk space.Type df -h to get a more easily readable version of the output. Notice that thiscommand will include all applicable storage such as your hard disk/s (hda, hdbetc.) and your server SWAP file (shm). To list disk space including filesystemtype:df -h -TUse finger to see who's on the system Typing finger allows you to see who else ison the system or get detailed information about a person who has access to thesystem.Type finger followed by the name of a user's account to get information about thatuser. Or, type finger and press enter to see who's on the system and what they aredoing. Ex:finger johndoeUse logout to quit using the system Yep, you guessed it, typing logout will logyour account out of the system.Type logout at the prompt to disconnect from your Linux machine or to logout aparticular user session from the system. Keep in mind that although rudimentary,leaving your critical account logged on may be a security concern. We alwaysrecommend promptly using logout when you are finished using your root account! Ex:logoutUse ls to list files and directories Type ls to see a list of the files anddirectories located in the current directory. If you’re in the directory namedgames and you type ls, a list will appear that contains files in the gamesdirectory and sub-directories in the games directory. Examples:ls Maills /usr/binType ls -alt to see a list of all files (including .rc files) and all directorieslocated in the current directory. The listing will include detailed, often usefulinformation. Examples:ls -altls -alt /usr/bin
 
If the screen flies by and you miss seeing a number of files, try using the |moreat the end like:ls -alt |more* In Bash (Linux shell) often the abbreviated command L is available. To get averbose listing of files and directories you could therefore simply type: lUse man to pull up information about a Linux command Type man followed by acommand to get detailed information about how to use the command. Ex:man lsType man -k followed by a word to list all of the commands and descriptions thatcontain the word you specified. Ex:man -k fingerUse more to read the contents of a file Type more followed by the name of a textfile to read the file’s contents. Why do we exmphasize using this on a "text"file? Because most other types of files will look like garbage! Ex:more testfile.txtUse nano to start a text editor Typing nano will start a basic text editor on mostLinux systems.Type nano followed by the filename you wish to edit. This basic editor is quickand easy to use for beginners. However, it is very important that you also learnabout other text editors available on Linux and UNIX systems. Click on this linkto learn about others like emacs, vi, and pico. Ex:nano /etc/security/access.confUse passwd to change your current password Type passwd and press enter. You'll seethe message Changing password for yourname.At the Old password: prompt, type in your old password .Then, at the Enter new password: prompt, type in your new password .The system double checks your new password. Beside the Verify: prompt, type thenew password and press again.Create a secure password that combines parts of words and numbers. For instance,your dog's name may be Rufus. He may have been born in 1980. Create a passwordthat uses parts of both the name and date of birth, such as 80rufuS. Note the useof at least one capital letter. This is a fairly secure password and easy toremember.Use pwd to list the name of your current directory Type pwd and hit enter. You'llsee the full name of the directory you are currently in. This is your directorypath and is very handy. This is especially handy when you forget which directoryyou’ve changed to and are trying to run other commands.Summary UsearpCommand mostly used for checking existing Ethernet connectivity and IP addressMost common use: arpThis command should be used in conjunction with the ifconfig and route commands.It is mostly useful for me to check a network card and get the IP address quick.Obviously there are many more parameters, but I am trying to share the basics ofserver administration, not the whole book of commands.dfDisplay filesystem informationMost common use: df -hGreat way to keep tabs on how much hard disk space you have on each mounted filesystem.duDisplay usageMost common use, under a specific directory: du -a
 
Easily and quickly identify the size of files/programs in certain directories. Aword of caution is that you should not run this command from the / directory. Itwill actually display size for every file on the entire Linux harddisk.findFind locations of files/directories quickly across entire filesystemMost common use: find / -name appname -type d -xdev(replace the word appname with the name of a file or application like gimp)This is a very powerful command and is best used when running as root orsuperuser. The danger is that you will potentially look across every single fileon every filesystem, so the syntax is very important. The example shown allows youto search against all directories below / for the appname found in directories butonly on the existing filesystem. It may sound complex but the example shown allowsyou to find a program you may need within seconds!Other uses and more complex but beneficial functions include using the -exec orexecute a command.You may also try the commands: locate or try slocateifconfigCommand line tool to configure or check all network cards/interfacesMost common uses: ifconfig and also ifconfig eth0 10.1.1.1Using the plain ifconfig command will show you the details of all the alreadyconfigured network cards or interfaces. This is a great way to get a check thatyour network hardware is working properly. You may also benefit from this reviewof server configuration. Using the many other options of ifconfig such as the onelisted allows you to assign a particular interface a static IP address. I onlyshow an example and not a real world command above. Your best bet, if you want toconfigure your network card using this command is to first read the manual pages.You access them by typing: man ifconfiginitAllows you to change the server bootup on a specific runlevelMost common use: init 5This is a useful command, when for instance a servers fails to identify videotype, and ends up dropping to the non-graphical boot-up mode (also called runlevel3).The server runlevels rely on scripts to basically start up a server with specificprocesses and tools upon bootup. Runlevel 5 is the default graphical runlevel forLinux servers. But sometimes you get stuck in a different mode and need to force alevel. For those rare cases, the init command is a simple way to force the modewithout having to edit the inittab file.Of course, this command does not fix the underlying problem, it just provides afast way to change levels as needed. For a more permanent correction to therunlevel, edit your /etc/inittab file to state: id:5:initdefault:joe or nanoEasy to use command line editors that are often included with the major LinuxflavorsMost common uses:joe filenamenano filenameA real world example for you to get a better sense on how this works:nano /etc/dhcp3/dhcpd.confThis allows you to edit using nano the dhcpd.conf configuration file from thecommand line.
of 00

Leave a Comment

You must be to leave a comment.
Submit
Characters: ...
You must be to leave a comment.
Submit
Characters: ...