Unix Command

  • November 2019
  • PDF

This document was uploaded by user and they confirmed that they have the permission to share it. If you are author or own the copyright of this book, please report to us by using this DMCA report form. Report DMCA


Overview

Download & View Unix Command as PDF for free.

More details

  • Words: 340
  • Pages: 1
uname -a pwd clear

touch

mkdir rmdir rm

cp

Lists files. The equivalent of "dir" in DOS. Common switches are -al which will list all files with a long description, including their permissions, size, and datestamp. You can also type in ls -al followed by a specific filename to learn information about that specific file. This is helpful if you have many files within a directory and you only want information on one of them. You can even use wildcards. For example, ls *.html show only files with extension .html Show info about current machine and operative system Print Working Directory. Wonder which directory you're currently in? This reveals full path. clear the screen touch filename. If filename doesn't exist it gets created (0 byte). If filename already exists, touch alters its timestamp to the current time. Please note, in UNIX we can not easily name files with spaces in them, so words should use underscores or a capital letter to separate them. For example, touch my file will not work. You must write either touch myFile or touch my_file . This applies to creating directories as well. makes a directory. You can put files in a directory :) removes an empty directory. If it is not empty, you can use rm -rf instead. removes files. You can use it with wildcards too. For example rm -f *.html will remove all html files in the directory. You can use it to remove a directory with an -rf switch. However, this is not the ideal way to remove directories. cp originalFile newFile Creates a copy of the first file having the name of the second. If the paths are not specificied, then cp assumes you mean the current working directory. You can also copy a file to another location. For example, cp OriginalFile /home/someDirectory/newFile will copy a file from the current directory to another directory with "NewFile" as it's name. If no name is specified, and you are copying the file to another directory, then the original filename will be used.

Related Documents

Unix Command
November 2019 26
Unix Command
August 2019 26
Unix Command Summary
November 2019 9
Short Command Unix
May 2020 6
Unix Command Dictionaries
October 2019 13