UNIX. Basic UNIX Command

Similar documents
Computer Systems and Architecture

Welcome to getting started with Ubuntu Server. This System Administrator Manual. guide to be simple to follow, with step by step instructions

Computer Systems and Architecture

Embedded Linux Systems. Bin Li Assistant Professor Dept. of Electrical, Computer and Biomedical Engineering University of Rhode Island

Introduction to Linux

Introduction to the UNIX command line

Lab Working with Linux Command Line

Basic Unix Commands. CGS 3460, Lecture 6 Jan 23, 2006 Zhen Yang

Linux Essentials Objectives Topics:

Course 144 Supplementary Materials. UNIX Fundamentals

Outline. Structure of a UNIX command

Introduction to remote command line Linux. Research Computing Team University of Birmingham

Linux Command Line Primer. By: Scott Marshall

SIEMENS UserAdmin Workshop TELEPERM XP Version 4 Chapter 1

Set 1 MCQ Which command is used to sort the lines of data in a file in reverse order A) sort B) sh C) st D) sort -r

CHAPTER 1 UNIX FOR NONPROGRAMMERS

CS4350 Unix Programming. Outline

Introduction to Unix May 24, 2008

2) clear :- It clears the terminal screen. Syntax :- clear

UNIX Quick Reference

Introduction p. 1 Who Should Read This Book? p. 1 What You Need to Know Before Reading This Book p. 2 How This Book Is Organized p.

Unix Tools / Command Line

Lab 2A> ADDING USERS in Linux

Some useful UNIX Commands written down by Razor for newbies to get a start in UNIX

List of Linux Commands in an IPm

Linux Essentials. Programming and Data Structures Lab M Tech CS First Year, First Semester

First of all, these notes will cover only a small subset of the available commands and utilities, and will cover most of those in a shallow fashion.

Table of contents. Our goal. Notes. Notes. Notes. Summer June 29, Our goal is to see how we can use Unix as a tool for developing programs

Getting Started With UNIX Lab Exercises

CSCM98 Lab Class #5 Getting familiar with the command line

Unix Introduction to UNIX

The Unix Shell & Shell Scripts

Unix/Linux Basics. Cpt S 223, Fall 2007 Copyright: Washington State University

Introduction to UNIX command-line

Presented by Bill Genske Gary Jackson

System Programming. Introduction to Unix

First of all, these notes will cover only a small subset of the available commands and utilities, and will cover most of those in a shallow fashion.

Unix/Linux Operating System. Introduction to Computational Statistics STAT 598G, Fall 2011

Introduction to Linux

Operating Systems. Copyleft 2005, Binnur Kurt

Operating Systems 3. Operating Systems. Content. What is an Operating System? What is an Operating System? Resource Abstraction and Sharing

The kernel is the low-level software that manages hardware, multitasks programs, etc.

Introduction of Linux

LAB #7 Linux Tutorial

Linux Nuts and Bolts

IMPORTANT: Logging Off LOGGING IN

First of all, these notes will cover only a small subset of the available commands and utilities, and will cover most of those in a shallow fashion.

Short Read Sequencing Analysis Workshop

acmteam/unix.pdf How to manage your account (user ID, password, shell); How to compile C, C++, and Java programs;

THE HONG KONG POLYTECHNIC UNIVERSITY Department of Electronic and Information Engineering

FREEENGINEER.ORG. 1 of 6 11/5/15 8:31 PM. Learn UNIX in 10 minutes. Version 1.3. Preface

Getting Started. Running Utilities. Shells. Special Characters. Special Characters. Chapter 2 Unix Utilities for non-programmers

Lecture 02: Linux Command Line

Basic Linux Commands. Srihari Kalgi M.Tech, CSE (KReSIT), IIT Bombay. May 5, 2009

Read the relevant material in Sobell! If you want to follow along with the examples that follow, and you do, open a Linux terminal.

Introduction to UNIX. Logging in. Basic System Architecture 10/7/10. most systems have graphical login on Linux machines

Lecture # 2 Introduction to UNIX (Part 2)

Unix Filesystem. January 26 th, 2004 Class Meeting 2

CS/CIS 249 SP18 - Intro to Information Security

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

This lab exercise is to be submitted at the end of the lab session! passwd [That is the command to change your current password to a new one]

Introduction to UNIX Command Line

National University of Computer and Emerging Sciences Operating System Lab - 02 Lab Manual

for more :-

CS Fundamentals of Programming II Fall Very Basic UNIX

Introduction to Linux

Introduction to Linux Environment. Yun-Wen Chen

Chapter Two. Lesson A. Objectives. Exploring the UNIX File System and File Security. Understanding Files and Directories

Introduction: What is Unix?

Basic Linux Command Line Interface Guide

Linux Kung Fu. Ross Ventresca UBNetDef, Fall 2017

Unix Basics. Systems Programming Concepts

M.C.A. (Sem.-lll) (CBCS) Examination November CCA-3003 Operating System and LinuxlUnix programming

Perl and R Scripting for Biologists

Operating Systems Lab 1 (Users, Groups, and Security)

Basic Linux Command Line Interface Guide

Mills HPC Tutorial Series. Linux Basics I

Linux Training. for New Users of Cluster. Georgia Advanced Computing Resource Center University of Georgia Suchitra Pakala

CSCI 2132 Software Development. Lecture 4: Files and Directories

Physics REU Unix Tutorial

Useful Unix Commands Cheat Sheet

Lecture 3. Unix. Question? b. The world s best restaurant. c. Being in the top three happiest countries in the world.

5/8/2012. Creating and Changing Directories Chapter 7

Linux Reference Card - Command Summary

History. Terminology. Opening a Terminal. Introduction to the Unix command line GNOME

GNU/Linux 101. Casey McLaughlin. Research Computing Center Spring Workshop Series 2018

Appendix B WORKSHOP. SYS-ED/ Computer Education Techniques, Inc.

UNLV Computer Science Department CS 135 Lab Manual

Introduction to UNIX. Introduction EECS l UNIX is an operating system (OS). l Our goals:

Computer Architecture Lab 1 (Starting with Linux)

UoW HPC Quick Start. Information Technology Services University of Wollongong. ( Last updated on October 10, 2011)

Linux command line basics II: downloading data and controlling files. Yanbin Yin

[ Terminal ] [ Users management ] Alt +F6 = Terminal switcher. useradd [option] JohnG

QUESTION BANK ON UNIX & SHELL PROGRAMMING-502 (CORE PAPER-2)

A Brief Introduction to Unix

Introduction to Linux (Part I) BUPT/QMUL 2018/03/14

UNLV Computer Science Department CS 135 Lab Manual

CENG 334 Computer Networks. Laboratory I Linux Tutorial

IBM AIX Basic Operations V5.

CSE Linux VM. For Microsoft Windows. Based on opensuse Leap 42.2

Transcription:

UNIX Basic UNIX Command

Command List ls mkdir mv chmod groupadd hostname kill head top compress/ uncompress pwd Cat find chown useradd id ioscan pdf sar cd more grep chgrp passwd mount dmesg netstat tar rm cp touch su uname ps tail ifconfig

ls ls -- listing file and directories Most Commonly used options are: - a Listing all entries, including whose names begin with a period (.) are not listed - l List in long format - F After each file name, put one slash (/) if the file directory or an asterisk (*) if the file is executive. ls -alf

pwd pwd -- Show current directory Most Commonly used options are: -L Display the logical current working directory. -P Display the physical current working directory (all symbolic links resolved). pwd [-L -P]

cd Changing Working directories Can use with absolute path and relative paths Using without any argument will redirect to User s HOME directory cd Desktop

rm Removing files or directories OPTIONs -f Force each file or directory to be removed without prompting for confirmation, regardless of the permissions of the entry -i Write a prompt to standard error requesting confirmation before removing each entry. This option ignores any previous occurrence of the -f option rm myfile

mkdir Create a directory mkdir myfolder mkdir /Users/xinuosx/Desktop/myFolder

rmdir Remove a directory Can only remove if directory is empty. rmdir myfolder rmdir OfficeDocuments rmdir: OfficeDocuments: Directory not empty

cat cat - concatenate, copy, print files Cat reads each file in a sequence and writes it on the standard output. Thus cat file prints file on the default standard output device. cat file1 file2 > file3 (concatenate file1 and file2, and place the result in the file3)

more Display the contents of a file one page at a time more filename

cp Copy file and directory subtrees. 1. Copy file1 to new or existing new_file, cp file1 new_file 2. Copy file1 to existing directory cp file1 destination_directory 3. To create a zero-length file, cp /dev/null file

mv Move or Rename file and directories 1. Move file1 to new or existing file, mv file1 new_file 2. Move file1 to existing directory cp file1 destination_directory 3. Rename a file in the current directory, mv old_filename new_filename

grep Search a file for a pattern To search a file named address containing the following entries, Mohamed Nasheed Mohamed Waheed Hilaaleege Maumoon A Gayoom Theemuge The command: grep Maumoon address prints: Maumoon A Gayoom Mulee Aage Theemuge

touch Update access, modification, and /or change times of file Usually, touch is used to create a new file. To create a zero-length file, use touch Wataniya

chmod Change file mode access permission. SYNOPSIS chown numeric_mode file.. To change the access permission of file1 to 664 chmod 664 file1

chown, chgrp Change file owner of group SYNOPSIS chown [-R] owner[:group] file.. The following command searches the directory design_notes and changes each file in that directory to owner mark and group chown -R mark: users design_note

SUDO First man: Make me a sandwich. Second man: What? Make it yourself. First man: Sudo make me a sandwich. Second man: Okay...

su Change User SYNOPSIS su [-] [username] The following command will change user and user s environment variable su - zameem The following command will only change user s permission su zameem

groupadd Add a new group to the system SYNOPSIS groupadd [-g gid] grpup Add the group projectx to etc/group file with the group idd 117. groupadd - g 117 projectx

useradd Add a new user login to the system SYNOPSIS useradd [-u uid] [-g gid] [-d dir] [-s shell] [c - cooment] [-m] login Add the user xinuosx to the system with a UID of 222, base directory /user/xinuosx, sbin/csh as its default shell, and a primary group of staff useradd -u 222 -g staff /user/xinuosx -m -s /sbin/csh xinuosx

passwd Change login password and associated attributes To Change the password of user xinuosx, use passwd xinuosx

uname Display information about computer system EXAMPE uname - a Darwin Mohamed-Faisals-iMac.local 10.4.0 Darwin Kernel Version 10.4.0: Fri Apr 23 18:28:53 PDT 2010; root:xnu-1504.7.4~1/ RELEASE_I386 i386

hostname set or display name of current host system EXAMPE The command hostname may produce the output like; Mohamed-Faisals-iMac which means the host name is Mohamed- Faisals-iMac

id Print user and group IDs and mames EXAMPE To Display the current user and group data, use id which produce uid=501(xinuosx) gid=20(staff) groups=20 (staff)

mount Display the already mounted file system EXAMPE The command mount may display /dev/disk0s2 on / (hfs, local, journaled) devfs on /dev (devfs, local, nobrowse)

ps Report process status The most commonly used options of ps are: -e select all process -f show common user, pid, ppidm cpu, stime, tty, time and args in that order EXAMPE Generate a full listing of all process currently running on your machine, use; ps - ef

kill Send a signal to a process; terminate a process SYNOPSIS: kill - signum pid UID PID PPID C STIME TTY TIME CMD 0 1 0 0 4:17.82?? 4:19.89 /sbin/launchd 0 10 1 0 0:01.73?? 0:24.34 /usr/libexec/kextd 0 11 1 0 0:24.42?? 1:06.88 /usr/sbin/directoryservice 0 12 1 0 0:02.43?? 0:03.94 /usr/sbin/notifyd

dmesg Collect system diagnostic message to from error log EXAMPE dmesg is mainly used to display the current memory usage.

ifconfig Configure network interface parameters EXAMPE The command ifconfig lan1 may output en1:flags=8863<up,broadcast,smart,running,simplex,multicast> mtu 1500 ether 04:1e:64:f1:fe:a6 inet6 fe80::61e:64ff:fef1:fea6%en1 prefixlen 64 scopeid 0x6 inet 192.168.1.100 netmask 0xffffff00 broadcast 192.168.1.255 media: <unknown subtype> status: active

sar System activity reporter EXAMPE Watch CPU activity evolve for 5 seconds. sar 1 5 or sar -u 1 5 Report buffer activity sar -b 1 5 Report activity for each block device, eg disk or tape drive; sar -d 1 5

tar Tar is used to archive file To archive file1, file2 and file3 into file.tar, use tar -cvf file.tar file1 file2 file3 To display the contents of a archived file.tar, use tar -cvf file.tar To unachieved a archived file.tar, use tar -xvf file.tar

compress/uncompress Compress and expand data Compress the file name zenith and print compression information to the terminal compress -v zenith Undo the compression by typing either of following commands; uncompress zenith.z compress -d zenith.z

VI Esc Switch between input mode and input mode and command mode a Insert after current character i Insert before current character s Replace current character dd Drop a line o Insert new line after cursor O Insert new line before cursor x Remove current character h/l Move left/right j/k Move down/up :w Save :q Exit ctr+b Roll back on screen Ctr+f Roll forward one screen

Thank You