Jump to content

useful newbie console commands


phanly
 Share

Recommended Posts

Here is a list of linux console/terminal commands I found useful in installing alsa-driver-0.9.8 for my system. Some might be Mandrake or RedHat specific.

I hope they save you lots of time. Some were found in Australian Linux Journal Issue 1.

 

Useful Linux console commands for newbies installing drivers

 

A. Software installation

 

bunzip2 (unzips a .bz2 file into teh same directory and drops the .bz2 extension)

tar -xf (undoes a .tar file and puts the files in a new subdirectory with a name based on the name of the tar file but without .tar)

NB after using the tar -xf command, swap into the new directory and read any read.. and install files.

./configure (with -- switches . produces a configure file which will be read by the make command to compile before running make install )

make (build (compile, link, etc) a project described in the Makefile found in the current directory)

make install (installs modules as per the directions in the make file)

make clean (delete the executable file and all the object files from the directory)

make uninstall (uninstalls software provided the make file still exists and has appropriate instructions - if make uninstall doesn't work it is a tedious manual process to uninstall)

insmod (inserts a moduel but no diagnostics)

modprobe (installs a module with some diagnostic info)

depmod -ae (tells what the problems are in a module)

lsmod (lists installed modules)

patch (patch <name of file that needs patch> <name of file with patch>)

urpmi (mandrake rpm command to get package and install eg urpmi alsamixergui)

rpm -q (is rpm package installed eg rpm -q alsamixergui)

rpm -Uvh -aid (install or upgrade package eg rpm -Uvh -aid alsamixergui)(the -aid might be RedHat specific and depend n a macro being installed)

rpm - Fvh -aid (freshen package))(the -aid might be RedHat specific and depend n a macro being installed)

rpm -e (uninstall and rpm package)

rpm -V (verify the files within an rpm package are correct)

rpm -qi (get information about an installed rpm package)

rpm -qip (list the files in a package file)

rpm -qf (which package installed a particular file eg rpm -qf alsamixer)

rpm -checksig (check the digital signature of a package)

rpm -qa -last (find out when all software was installed on a system

 

 

 

B. Diagnostics

 

lspci -v (list pci devices in a verbose manner ie with lots of info)

modprobe -ae (probe modules for dependencies that are not met)

 

C. File handling

 

cp (copy eg cp "Old File" "New Copy" )

mkdir name (make a directory called name in the current place)

pwd (list the full path of the current working directory)

ls -la (lists the contents of the current directory one line per file or folder)

dir (lists the contents of the current directory)

cd (change into a directory eg: cd /usr/src If no path it must be a subdirectory)

touch (creates a new empty file eg: touch "New File" or touch NewFile)

mkdir (make a new directory eg mkdir NewDir or mkdir "New Directory")

mv (moves a file from one directory to another eg move "New File" "new directory")

rm (remove (delete) a file/directory) eg rm "old file" or rm oldfile)

mv (can be used to rename a file eg mv "new File" "renamed file" - ??? what is the difference between moving to a new directory and changeing a file name?

su (change to supervisor mode ie become root (requires password to be entered next))

whoami (lists user logged in)

exit (if logged in as root - logs root out and resumes as previous user)

exit (if logged in not as root - ends console session)

 

D. File permissions

 

File permissiions are written using 3 characters for each of user group and others in that order.

The 3 characters represent read write and execute. enabled permissions are shown by the relevant letter rwx. Disabled permissions are indicated by a -. A permissions for a file could look like:

rwxr-----

If the user for this file was root then root could read write and execute the file, anyone in the root group but not root could read the file but not write or execute it and others could not read write or execute it. Permissions are called modes.

chmod g+rw <path/filename> (give group read and write access)

chmod u-x <path/filename> (remove user execute permission from filename file in the path shown)

chmod u=rwx,g=rx,o= <path/filename> (gives the permissions indicated to each of user, group and others, and other permissions not indicated are disabled)

chgrp (change the group to which a file belongs eg chgrp sales <path/filename> puts the file or directory filename in the path into the sales group.

chown (change the owner of a file to a know user eg chown david <path/filename>)

Link to comment
Share on other sites

  • 2 months later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...