1 / 10

Introduction to Computer Organization & Systems

This comprehensive guide covers the basics of UNIX command line, including file and directory manipulation, process management, killing processes, working with environmental variables, using pipes, and redirection techniques.

eshields
Download Presentation

Introduction to Computer Organization & Systems

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Introduction to Computer Organization & Systems COMP 21000 Spring 2018 Topics: • UNIX command line • C - everything UNIX/Linux Command Line

  2. Unix • Passwords • Changing • passwd • whoami • finger and the .plan file • Help • about a command • man cmdName • apropos cmdName • which cmdName ;gives path to the application

  3. Unix • Directories • Seeing, manuvering, creating • cd /path/to/new/directory • pwd • ls [-a –l] • mkdir dirName • rmdir dirName • rm –r dirName • pushd . • popd

  4. Unix • Files • Moving, deleting • cp src dest • rm fileName • Viewing • more fileName • cat fileName1 fileName2 • Permissions • ls –l • chmod 777 fileName

  5. Unix • Processes • What’s running? • ps ;only your processes • ps –a ;all processes PID TTY TIME CMD 33129 ttys000 0:00.02 -bash 33178 ttys000 0:00.00 man builtin 33186 ttys000 0:00.00 /usr/bin/less -is 33131 ttys001 0:00.01 -bash 33130 ttys002 0:00.02 –bash

  6. Kill • kill command is used to stop a running process • A user can kill all his process. • A user can not kill another user’s process. • A user can not kill processes System is using. • A root user* can kill System-level-process and the process of any user. * the root is the administrator

  7. Kill • kill -9 pid;kill process pid • other ways to kill • kill by name • pkilla.out;kill all processes named a.out • kill on the command line • ^c ;hold down control key and press the c key ;kills currently running process

  8. More Unix • Shells • Environmental variables (capitalization counts!) • Echo $ENV • $PATH • .bashrc and.bash_profile files • alias • changing $PATH • using source to act on changes to the file • Pipes • using the | operator to connect programs

  9. More Unix • Redirection • using >and>> to redirect stdout to a file • > to overwrite • >> to append • using &> to redirect stdout and stderr to a file gcc –g -o ex1 ex1.c > err.txt &> err.txt • using < to redirect stdin from file • History • the ! operator

More Related