Unix Command Project Justin Rogers for LS 560 Spring 2015.

18
Unix Command Project Justin Rogers for LS 560 Spring 2015

Transcript of Unix Command Project Justin Rogers for LS 560 Spring 2015.

Page 1: Unix Command Project Justin Rogers for LS 560 Spring 2015.

Unix Command Project

Justin Rogers for LS 560 Spring 2015

Page 2: Unix Command Project Justin Rogers for LS 560 Spring 2015.

Login

Logging into a server via command prompt or Secure Shell program gives you access to all of your files and directories stored on the server. This also allows you to alter, remove, or update files without having to go through an FTP client.

Page 3: Unix Command Project Justin Rogers for LS 560 Spring 2015.

ls

The list command allows you to see what files you have in the current directory which is helpful in two ways. First, it allows you to see which files you have in a directory so you can start to edit them if need be. Second, it allows you to make sure you are actually in a certain directory.

Page 4: Unix Command Project Justin Rogers for LS 560 Spring 2015.

cd

This command, cd, followed by the name of a listed directory allows you to move into the new directory. This would allow you to explore more of the files on your server, and it also lets you move directly between directories if you know the directory names.

Page 5: Unix Command Project Justin Rogers for LS 560 Spring 2015.

cd ..

The cd.. command allows you to move back to the previous directory. This allows you to have a “back button” function to move between directories quickly with typing in the directory name every time.

Page 6: Unix Command Project Justin Rogers for LS 560 Spring 2015.

mkdir

The mkdir command, along with a new directory name, will create a new directory in whichever directory you are in currently. This means that you can create directories and move files into them without having to use an FTP client, saving you some time.

Page 7: Unix Command Project Justin Rogers for LS 560 Spring 2015.

cd newpage

Once you make a new directory you can you can move into it by using the cd command, as shown previously. Remember to spell the directory name exactly as it is listed.

Page 8: Unix Command Project Justin Rogers for LS 560 Spring 2015.

history

The history command shows a list of the last commands that you have used in the session. This is helpful when needing to know where exactly you have been recently on the server. For example if you created a new directory then moved into other directories, but then you forgot what you named your new directory. Instead of searching through dozens of directories to find the one, you could just pull up your history.

Page 9: Unix Command Project Justin Rogers for LS 560 Spring 2015.

date

The date command allows you to see the current date and time. This would be beneficial in case you needed to check the date and time based on the server to update a file or directory.

Page 10: Unix Command Project Justin Rogers for LS 560 Spring 2015.

who

The who command allows you to see who is currently logged into the server along with you and the time they logged into the server. This could be helpful if you and other collaborators were maintaining server files at the same time. It would allow you to see who was on, and who might be updating the same files as you.

Page 11: Unix Command Project Justin Rogers for LS 560 Spring 2015.

cal

The cal command gives you the ability to look at the current month’s calendar. This could be useful if you don’t have a calendar on hand and need to update a schedule on a file in the server.

Page 12: Unix Command Project Justin Rogers for LS 560 Spring 2015.

rmdir

The command rmdir, along with the name of a directory, will delete the named directory from the server. This is extremely helpful for clearing up space in directories by removing old or unnecessary files or directories. Take note though that you cannot be in the directory that you are trying to delete.

Page 13: Unix Command Project Justin Rogers for LS 560 Spring 2015.

ls -l

The ls –l command, or the long list command, presents a detailed list of all the directories and files in the current directory. The details include the name, permissions, where it’s located, and when it was created. This is helpful in a number of ways. It lets you know what permissions you have for a directory (e.g. read, write, execute). It also tells you when a directory was created so that you can keep track of previous work.

Page 14: Unix Command Project Justin Rogers for LS 560 Spring 2015.

Directory Permissions

drwxr-----The ls –l command gives you a detailed list of the files/directories within the current directory. Among the details are the permissions for the directories, shown as d, r, w, x, and -, also known as symbolic notation. The first, “d”, denotes that it is a directory. The next 9 characters are actually 3 sets of 3 characters, always in the order “rwx.” These show you what user groups have what permissions for this directory starting with the account owner, then the group class, and lastly the others class. The “r” stands for the ability to read the directory. The “w” stands for the ability to write in the directory. The “x” stands for the ability to use executable functions in the directory, and the “-” represents that whichever permission it takes up is not available to the class. So for instance, “drwxr-----” would mean that in the directory the account owner has read, write, and executable permissions. The group class has only read permissions, and the others class has no permissions.

Page 15: Unix Command Project Justin Rogers for LS 560 Spring 2015.

grep

Grep stands for globally search a regular expression and print. This command allows you to specify a word and a directory and it will generate a list of all of the occurrences of the specified word (i.e. grep word directory). This command is great for quickly searching for any particular word or item associated with an html tag. For example, you could search an html document for all the instances of the href tag to see how many links you have on the webpage.

Page 16: Unix Command Project Justin Rogers for LS 560 Spring 2015.

exit

The exit command properly logs you out of the server. This is important because it can hinder other users if you are still in certain directories that they want to update.

Page 17: Unix Command Project Justin Rogers for LS 560 Spring 2015.

w

The w command shows you who’s logged on and what they’re doing. This is useful for knowing who is working on what directories. It also shows you how long the user has been idle.

Page 18: Unix Command Project Justin Rogers for LS 560 Spring 2015.

pwd

Pwd shows you the directory you are currently in plus the directory path. This would be very helpful if you ever forget which directory you are in, or you need to see the complete directory path for your directory.