Interface Management
To reset the graphical display, in case of a driver conflict:
1. Press [Ctrl]+[Alt]+[F1]
# [F1] to [F6] will all change to non-graphical screens, so if [F1] is running some other function, select one of the other non-graphical screens. Outside of the graphical screen, [Alt]+[Function Key] is used to switch between screens; [Ctrl] is only required when exiting the GUI (Graphical User Interface).
2. Log in as the root user
3. $ ps -ef | grep gdm
# This will show the processes currently running. We want the process at the top of the list, located at /usr/sbin/gdm
4. $ kill -9 [process #]
# i.e. kill -9 1441
5. $ sax2
# To rebuild the graphical display
To switch from the GUI (graphical user interface) to a non-graphical environment:
1. Press [Ctrl]+[Alt]+[F1]
# [F1] to [F6] each represent a separate non-graphical screens. Outside of the graphical screen, [Alt]+[Function Key] is used to switch between screens; [Ctrl] is only required when exiting the GUI (the Graphical User Interface).
2. Log in with user name and password
To switch a virtual machine from the GUI (graphical user interface) to a non-graphical environment:
1. Hold down [Ctrl]+[Alt], then press and release [Spacebar], then press and release the function key ([F1] to [F7]) for the desired screen.
# This is for switching between screens within a virtual environment, such as VMPlayer, where the regular [Ctrl]+[Alt] command will automatically return control to the host operating system
# [F1] to [F6] will all change to non-graphical screens. [F7] will activate the graphical screen, or GUI (Graphical User Interface).
2. Log in with user name and password
Directories and Files
To copy linux manual (man) pages to a printable file:
1. $ man [target command] > [path/filename]
To list files with a particular extension in a local directory, with the files sizes in human readable format:
1. $ ls *.[ext] -lh
To list files with a particular extension in a remote directory, with the files sizes in human readable format:
1. $ ls /[path]/*.[ext] -lh
# This is the full path starting from the root directory
2. $ ls [path]/*.[ext] -lh
# This is the path starting from the local directory
Creating a link to a file:
1. $ ln [target path/filename] [link name]
# Links in Linux are essentially the same as creating a copy of a file in one directory and pasting it into another directory, in Microsoft Windows(R). Although the file, itself, will be located in multiple directories, each instance of the file will be linked to the original file, so that if the contents of the file are modified in one location, all of the linked copies will be modified, as well.
# The target path and file name represent the originating file, to be copied. If you are placing the link in your current working directory, it is not necessary to state the path for the link name.
Creating a symbolic link to a file:
1. $ ln -s [target path/filename] [link name]
# Symbolic links in Linux serve the same function as a shortcut icon in Microsoft Windows(R); it directs the operating system to the location of the file or application, without moving any data from the original directory to the host directory of the link.
# The benefit of symbolic links is that a file can be located in one directory and access can be given to execute that file from another directory, without duplicating disk space consumption. Also, permissions may be set on a symbolic link to allow other users or groups to execute a file, without sacrificing the security or integrity of the originating file.
# The target path and file name represent the originating file, to be copied. If you are placing the link in your current working directory, it is not necessary to state the path for the link name.
Setting File Characteristics
Changing permissions for a file or directory:
1. $ chmod 755 [filename]
# Permissions are based on 3-bit designations for the owner, owner's group, and other groups, in that order. Bit number one (the right-most bit) activates the execute (x) privilege, bit two (to the left of bit one) activates the write (w) privilege, and bit three activates the read (r) privilege.
# Therefore, the chmod example above allows the owner of the file to read, write or execute it (each bit doubles the numerical value of the one to the right of it, so 4+2+1=7), but other users in the file owner's group, and other groups, are only allowed to read and execute the file, without the ability to write any modifications to it, because only the first and third bits are set (4+1=5).
Changing ownership of a file or directory:
1. $ chown [username]:[group] [filename]
# This will affect who is allowed to read, modify, or execute the file or directory, depending on the permissions set (see "Changingg permissions for a file or directory:" above). If you are not the current owner of the file, reassignment of the user and group will need to be performed as the super user (root).