{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

BTO120 Linux Notes for Test 1

BTO120 Linux Notes for Test 1 - BTO120 Linux Notes for Test...

Info icon This preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
BTO120 Linux Notes for Test 1 Some Commands pwd will show your current directory cd is used to change current directory, eg. cd directory-name ls - lists information about files and directories o ls -a - all files (including hidden) o ls -l - long form, gives more information about files o ls -d - gives information about the directory itself, not contained files o these options can be mixed and matched, eg. ls -ld cal - displays a calendar of the current month o cal 1995 - displays calendar for specified year o cal 3 1995 - displays calendar for specified month of specified year date - gives date and time who , w - information about users logged on to system o who am i , whoami - information about your session BTO120 - Operating Systems for Programmers - UNIX Lecture 2 - Common Commands; Simple Filter Commands Common Commands touch - creates a new file, or updates stats on an existing file mkdir - to create directories o mkdir -p - to create a directory & any parent directories not already existing rmdir - to delete empty directories, eg. rmdir directory-list mv existing-file new-file - to rename or move files & directories cp source-file destination-file - to copy files (careful, overwrites destination with no warning) o cp -R - to copy directories including files and subdirectories rm - to delete files, eg. rm file-list o rm -r - to delete directories including files and subdirectories o rm -ir - to delete directories including files and subdirectories, with prompt to confirm removal cat filename - display contents of file more or less - displays file contents one page at a time o <space bar> - will go to next page o b - will go to previous page o /string - will search for string within document being viewed o q - will quit file filename - gives info about the contents of the file
Image of page 1

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
find - to find files matching specified characteristics o find . -name file* - lists pathname of any filenames beginning with "file", from the current directory and any subdirectories o find . -size +50k - lists pathname of any files larger than 50 kb, from the current directory and any subdirectories o find . -user alice -empty -delete - deletes empty files owned by user "alice" o find . -mmin -5 - lists files modified less than 5 minutes ago man command - online manual (or help) for command, uses more to display information o man -k keyword - eg. man -k calendar - searches through man sections for keyword o similar commands: apropos , whatis , info diff file1 file2 - displays differences between 2 files o similar commands: cmp and comm echo text or $variable (eg. $USER) stty - determine and set terminal characteristics o stty -a - will show all terminal capabilities o stty -g - will show all terminal capabilities in machine- readable form can be used to reset terminal characteristics in scripts o stty -echo - disables echoing of typed characters o stty echo - enables echoing command history o <Up> or <Down> - move to previous command or next command o fc -l - display last 16 commands o history - display all commands in buffer o !num - re-execute command number "num" o !xxx
Image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern