Linux has a multi-layered system organization with applications and utilities at the outer layer, a kernel interacting directly with hardware at the inner layer, and a middle layer like desktops and shells facilitating communication. It provides multi-user access with login security and file/folder permissions. Common commands to manage files/folders include ls to list, touch/cat to create/edit, cp to copy, mv to move, rm to delete, and chmod to change permissions. The file system hierarchy has directories like home, bin, lib, etc. Disk space is allocated in blocks and inodes track file attributes.
The document provides descriptions of various Linux commands for basic usage and pentesting. It describes commands for making directories (mkdir), deleting empty directories (rmdir), viewing processes (ps), checking username (whoami), checking disk space (df), displaying date and time (date), checking connectivity (ping), downloading files (wget), looking up domain registration records (whois), navigating directories (cd), listing directory contents (ls), displaying command manuals (man), displaying text files (cat), copying files (cp), moving and renaming files (mv), removing files and directories (rm), creating empty files (touch), searching files (grep), using administrative privileges (sudo), viewing start of files (head), viewing end of files (
This document provides an overview of Linux commands and basics. It begins with explaining Linux command line syntax and standard options. It then covers commands for checking system information like CPU, memory, disks. Directories, files, permissions and various file management commands like copy, move, delete are explained. Commands for viewing file contents like cat, head, tail and filters like grep, awk are summarized. The vim text editor and finding files using find and locate commands are briefly described. Process management using ps and kill is covered. User and group administration using useradd, groupadd and sudo is highlighted at the end.
The document summarizes the usage of various Linux commands like cd, bc, man, who, whoami, pwd, mkdir, rmdir, ls, touch, mv, date, cat, more, less, print, echo, lp, rm, cp and their options. It provides the syntax and examples of using each command. The commands covered are for directory navigation, file manipulation, text processing and printing files in Linux operating system.
The document provides an overview of Linux fundamentals, including:
- The Linux filesystem hierarchy and important files/folders like /etc, /bin, and /home.
- Commands for navigating the filesystem like cd, ls, and mkdir.
- Commands for working with files like touch, cp, mv, rm, cat, and nano.
- Finding files using commands like find and grep.
- Viewing and changing file permissions with ls, chown, chmod, and sudo.
Unix Shell Script - 2 Days Session.pptxRajesh Kumar
The document provides an overview of Unix and shell scripting. It discusses what Unix is, its architecture including the kernel, shell, commands, and filesystem. It then covers what shell scripts are, their components and syntax. The document provides examples of shell script code and discusses how to invoke scripts, execute them in background, and useful metacharacters. It also covers various Unix commands like ls, cd, grep, find and their usage.
Linux is an open source operating system initially created by Linus Torvalds in 1991. It has since grown significantly with hundreds of companies and individuals developing their own versions based on the Linux kernel. The kernel is developed under the GNU GPL license and its source code is freely available. Basic Linux commands allow users to navigate directories, manage files and permissions, transfer files, and get system information. More advanced commands provide additional control and functionality.
The document provides an introduction to Linux, including that it is an open-source operating system kernel created by Linus Torvalds. It discusses popular Linux distributions like Ubuntu and Red Hat Enterprise Linux. It also describes the Linux shell/terminal as the command line interface to interact with the operating system. Finally, it gives examples of common Linux commands for file management, system information, and archiving/compressing files.
Unix is a layered operating system with the kernel interacting directly with hardware and providing services to user programs through system calls. It is a multi-user, multi-tasking system with a hierarchical file structure and standard commands for manipulating files and directories. The shell acts as a command interpreter between the user and operating system, running commands and startup scripts on startup.
CompTIA Linux+ Powered by LPI certifies foundational skills and knowledge of Linux. With Linux being the central operating system for much of the world’s IT infrastructure, Linux+ is an essential credential for individuals working in IT, especially those on the path of a Web and software development career. With CompTIA’s Linux+ Powered by LPI certification, you’ll acquire the fundamental skills and knowledge you need to successfully configure, manage and troubleshoot Linux systems. Recommended experience for this certification includes CompTIA A+, CompTIA Network+ and 12 months of Linux admin experience. No prerequisites required.
This document provides an overview of various Linux command line topics including command line basics, permissions, the man command, hard and soft links, network settings, RPM packages, YUM repositories, kernel modes, and resizing partitions. It describes common commands for navigating files and directories, viewing manuals, changing permissions, creating links, configuring networks, building RPMs, installing packages with YUM, modifying kernel runlevels, and more. Diagrams and examples are provided to illustrate key Linux concepts and commands.
This document discusses managing the Linux file system. It describes the Linux file system structure, including the main directories like /bin, /home, /etc. It also covers common file system tasks like navigating directories, managing files and directories by creating, deleting, copying and moving files. Additional topics covered include managing disk partitions by creating partitions with fdisk and formatting partitions with file systems using mkfs, mounting partitions, and checking file systems with fsck.
This document provides a tutorial on Unix/Linux. It begins with an overview of the Unix system including the kernel, shell, multi-user and multi-process capabilities, and important directory structures. It then covers basic commands, relative and absolute paths, redirecting and piping output, permissions, process management, installing software, text editors, running jobs in the foreground and background, and remote login/file transfer. The goal is to introduce fundamental Unix concepts and commands to new users.
This document provides an overview and agenda for a 5-day UNIX/Linux training course. The training will cover Linux installations, desktops, command line administration, networking, and server/programming. Each day focuses on a different topic area. Day 1 is an introduction and installation. Day 2 covers Linux desktops and administration. Day 3 is Linux CLI administration. Day 4 is networking and internet. Day 5 is Linux servers and programming. The document also includes background information on Linux and UNIX as well as tips for Linux installations, file systems, users, commands, and performance.
This document provides an introduction to Linux and its components. It discusses that Linux is an operating system like Windows and Mac OS that manages communication between hardware and software. It then outlines the course curriculum which will cover topics such as the Linux kernel, shell, commands, file system, permissions and networking tools. Several sections then provide more detail on key aspects of Linux including what an operating system is, the parts of an operating system like the kernel and shell, and why Linux is widely used and advantageous over other operating systems.
The document provides information about various components of an operating system including:
- The kernel acts as an interface between hardware and software, allocating resources and managing tasks.
- Operating systems support single/multi-user and single/multi-tasking capabilities.
- Linux is an open source, multi-user operating system based on the Unix kernel that is used widely today.
The document provides an introduction to Linux, including its history and origins. It discusses how Linux was originally developed by Linus Torvalds as an open source alternative to UNIX. It also summarizes some key Linux distributions like Red Hat Linux and describes basic Linux commands, file structures, and permissions.
The document provides information on various features and commands in the UNIX operating system. It discusses multi-user and multi-tasking capabilities, the building block approach, and the UNIX tool kit. It also describes locating commands, internal and external commands, command structure, general purpose utilities like cal, date, echo, and bc. The document outlines file types, file names, directory commands, file commands, permissions, and vi editor basics.
How Top Companies Benefit from OutsourcingNascenture
Explore how leading companies leverage outsourcing to streamline operations, cut costs, and stay ahead in innovation. By tapping into specialized talent and focusing on core strengths, top brands achieve scalability, efficiency, and faster product delivery through strategic outsourcing partnerships.
Build with AI events are communityled, handson activities hosted by Google Developer Groups and Google Developer Groups on Campus across the world from February 1 to July 31 2025. These events aim to help developers acquire and apply Generative AI skills to build and integrate applications using the latest Google AI technologies, including AI Studio, the Gemini and Gemma family of models, and Vertex AI. This particular event series includes Thematic Hands on Workshop: Guided learning on specific AI tools or topics as well as a prequel to the Hackathon to foster innovation using Google AI tools.
Ad
More Related Content
Similar to various shell commands in unix operating system.pptx (20)
Unix Shell Script - 2 Days Session.pptxRajesh Kumar
The document provides an overview of Unix and shell scripting. It discusses what Unix is, its architecture including the kernel, shell, commands, and filesystem. It then covers what shell scripts are, their components and syntax. The document provides examples of shell script code and discusses how to invoke scripts, execute them in background, and useful metacharacters. It also covers various Unix commands like ls, cd, grep, find and their usage.
Linux is an open source operating system initially created by Linus Torvalds in 1991. It has since grown significantly with hundreds of companies and individuals developing their own versions based on the Linux kernel. The kernel is developed under the GNU GPL license and its source code is freely available. Basic Linux commands allow users to navigate directories, manage files and permissions, transfer files, and get system information. More advanced commands provide additional control and functionality.
The document provides an introduction to Linux, including that it is an open-source operating system kernel created by Linus Torvalds. It discusses popular Linux distributions like Ubuntu and Red Hat Enterprise Linux. It also describes the Linux shell/terminal as the command line interface to interact with the operating system. Finally, it gives examples of common Linux commands for file management, system information, and archiving/compressing files.
Unix is a layered operating system with the kernel interacting directly with hardware and providing services to user programs through system calls. It is a multi-user, multi-tasking system with a hierarchical file structure and standard commands for manipulating files and directories. The shell acts as a command interpreter between the user and operating system, running commands and startup scripts on startup.
CompTIA Linux+ Powered by LPI certifies foundational skills and knowledge of Linux. With Linux being the central operating system for much of the world’s IT infrastructure, Linux+ is an essential credential for individuals working in IT, especially those on the path of a Web and software development career. With CompTIA’s Linux+ Powered by LPI certification, you’ll acquire the fundamental skills and knowledge you need to successfully configure, manage and troubleshoot Linux systems. Recommended experience for this certification includes CompTIA A+, CompTIA Network+ and 12 months of Linux admin experience. No prerequisites required.
This document provides an overview of various Linux command line topics including command line basics, permissions, the man command, hard and soft links, network settings, RPM packages, YUM repositories, kernel modes, and resizing partitions. It describes common commands for navigating files and directories, viewing manuals, changing permissions, creating links, configuring networks, building RPMs, installing packages with YUM, modifying kernel runlevels, and more. Diagrams and examples are provided to illustrate key Linux concepts and commands.
This document discusses managing the Linux file system. It describes the Linux file system structure, including the main directories like /bin, /home, /etc. It also covers common file system tasks like navigating directories, managing files and directories by creating, deleting, copying and moving files. Additional topics covered include managing disk partitions by creating partitions with fdisk and formatting partitions with file systems using mkfs, mounting partitions, and checking file systems with fsck.
This document provides a tutorial on Unix/Linux. It begins with an overview of the Unix system including the kernel, shell, multi-user and multi-process capabilities, and important directory structures. It then covers basic commands, relative and absolute paths, redirecting and piping output, permissions, process management, installing software, text editors, running jobs in the foreground and background, and remote login/file transfer. The goal is to introduce fundamental Unix concepts and commands to new users.
This document provides an overview and agenda for a 5-day UNIX/Linux training course. The training will cover Linux installations, desktops, command line administration, networking, and server/programming. Each day focuses on a different topic area. Day 1 is an introduction and installation. Day 2 covers Linux desktops and administration. Day 3 is Linux CLI administration. Day 4 is networking and internet. Day 5 is Linux servers and programming. The document also includes background information on Linux and UNIX as well as tips for Linux installations, file systems, users, commands, and performance.
This document provides an introduction to Linux and its components. It discusses that Linux is an operating system like Windows and Mac OS that manages communication between hardware and software. It then outlines the course curriculum which will cover topics such as the Linux kernel, shell, commands, file system, permissions and networking tools. Several sections then provide more detail on key aspects of Linux including what an operating system is, the parts of an operating system like the kernel and shell, and why Linux is widely used and advantageous over other operating systems.
The document provides information about various components of an operating system including:
- The kernel acts as an interface between hardware and software, allocating resources and managing tasks.
- Operating systems support single/multi-user and single/multi-tasking capabilities.
- Linux is an open source, multi-user operating system based on the Unix kernel that is used widely today.
The document provides an introduction to Linux, including its history and origins. It discusses how Linux was originally developed by Linus Torvalds as an open source alternative to UNIX. It also summarizes some key Linux distributions like Red Hat Linux and describes basic Linux commands, file structures, and permissions.
The document provides information on various features and commands in the UNIX operating system. It discusses multi-user and multi-tasking capabilities, the building block approach, and the UNIX tool kit. It also describes locating commands, internal and external commands, command structure, general purpose utilities like cal, date, echo, and bc. The document outlines file types, file names, directory commands, file commands, permissions, and vi editor basics.
How Top Companies Benefit from OutsourcingNascenture
Explore how leading companies leverage outsourcing to streamline operations, cut costs, and stay ahead in innovation. By tapping into specialized talent and focusing on core strengths, top brands achieve scalability, efficiency, and faster product delivery through strategic outsourcing partnerships.
Build with AI events are communityled, handson activities hosted by Google Developer Groups and Google Developer Groups on Campus across the world from February 1 to July 31 2025. These events aim to help developers acquire and apply Generative AI skills to build and integrate applications using the latest Google AI technologies, including AI Studio, the Gemini and Gemma family of models, and Vertex AI. This particular event series includes Thematic Hands on Workshop: Guided learning on specific AI tools or topics as well as a prequel to the Hackathon to foster innovation using Google AI tools.
DevOpsDays SLC - Platform Engineers are Product Managers.pptxJustin Reock
Platform Engineers are Product Managers: 10x Your Developer Experience
Discover how adopting this mindset can transform your platform engineering efforts into a high-impact, developer-centric initiative that empowers your teams and drives organizational success.
Platform engineering has emerged as a critical function that serves as the backbone for engineering teams, providing the tools and capabilities necessary to accelerate delivery. But to truly maximize their impact, platform engineers should embrace a product management mindset. When thinking like product managers, platform engineers better understand their internal customers' needs, prioritize features, and deliver a seamless developer experience that can 10x an engineering team’s productivity.
In this session, Justin Reock, Deputy CTO at DX (getdx.com), will demonstrate that platform engineers are, in fact, product managers for their internal developer customers. By treating the platform as an internally delivered product, and holding it to the same standard and rollout as any product, teams significantly accelerate the successful adoption of developer experience and platform engineering initiatives.
Building a research repository that works by Clare CadyUXPA Boston
Are you constantly answering, "Hey, have we done any research on...?" It’s a familiar question for UX professionals and researchers, and the answer often involves sifting through years of archives or risking lost insights due to team turnover.
Join a deep dive into building a UX research repository that not only stores your data but makes it accessible, actionable, and sustainable. Learn how our UX research team tackled years of disparate data by leveraging an AI tool to create a centralized, searchable repository that serves the entire organization.
This session will guide you through tool selection, safeguarding intellectual property, training AI models to deliver accurate and actionable results, and empowering your team to confidently use this tool. Are you ready to transform your UX research process? Attend this session and take the first step toward developing a UX repository that empowers your team and strengthens design outcomes across your organization.
React Native for Business Solutions: Building Scalable Apps for SuccessAmelia Swank
See how we used React Native to build a scalable mobile app from concept to production. Learn about the benefits of React Native development.
for more info : https://www.atoallinks.com/2025/react-native-developers-turned-concept-into-scalable-solution/
Dark Dynamism: drones, dark factories and deurbanizationJakub Šimek
Startup villages are the next frontier on the road to network states. This book aims to serve as a practical guide to bootstrap a desired future that is both definite and optimistic, to quote Peter Thiel’s framework.
Dark Dynamism is my second book, a kind of sequel to Bespoke Balajisms I published on Kindle in 2024. The first book was about 90 ideas of Balaji Srinivasan and 10 of my own concepts, I built on top of his thinking.
In Dark Dynamism, I focus on my ideas I played with over the last 8 years, inspired by Balaji Srinivasan, Alexander Bard and many people from the Game B and IDW scenes.
Slack like a pro: strategies for 10x engineering teamsNacho Cougil
You know Slack, right? It's that tool that some of us have known for the amount of "noise" it generates per second (and that many of us mute as soon as we install it 😅).
But, do you really know it? Do you know how to use it to get the most out of it? Are you sure 🤔? Are you tired of the amount of messages you have to reply to? Are you worried about the hundred conversations you have open? Or are you unaware of changes in projects relevant to your team? Would you like to automate tasks but don't know how to do so?
In this session, I'll try to share how using Slack can help you to be more productive, not only for you but for your colleagues and how that can help you to be much more efficient... and live more relaxed 😉.
If you thought that our work was based (only) on writing code, ... I'm sorry to tell you, but the truth is that it's not 😅. What's more, in the fast-paced world we live in, where so many things change at an accelerated speed, communication is key, and if you use Slack, you should learn to make the most of it.
---
Presentation shared at JCON Europe '25
Feedback form:
http://tiny.cc/slack-like-a-pro-feedback
Middle East and Africa Cybersecurity Market Trends and Growth Analysis Preeti Jha
The Middle East and Africa cybersecurity market was valued at USD 2.31 billion in 2024 and is projected to grow at a CAGR of 7.90% from 2025 to 2034, reaching nearly USD 4.94 billion by 2034. This growth is driven by increasing cyber threats, rising digital adoption, and growing investments in security infrastructure across the region.
Refactoring meta-rauc-community: Cleaner Code, Better Maintenance, More MachinesLeon Anavi
RAUC is a widely used open-source solution for robust and secure software updates on embedded Linux devices. In 2020, the Yocto/OpenEmbedded layer meta-rauc-community was created to provide demo RAUC integrations for a variety of popular development boards. The goal was to support the embedded Linux community by offering practical, working examples of RAUC in action - helping developers get started quickly.
Since its inception, the layer has tracked and supported the Long Term Support (LTS) releases of the Yocto Project, including Dunfell (April 2020), Kirkstone (April 2022), and Scarthgap (April 2024), alongside active development in the main branch. Structured as a collection of layers tailored to different machine configurations, meta-rauc-community has delivered demo integrations for a wide variety of boards, utilizing their respective BSP layers. These include widely used platforms such as the Raspberry Pi, NXP i.MX6 and i.MX8, Rockchip, Allwinner, STM32MP, and NVIDIA Tegra.
Five years into the project, a significant refactoring effort was launched to address increasing duplication and divergence in the layer’s codebase. The new direction involves consolidating shared logic into a dedicated meta-rauc-community base layer, which will serve as the foundation for all supported machines. This centralization reduces redundancy, simplifies maintenance, and ensures a more sustainable development process.
The ongoing work, currently taking place in the main branch, targets readiness for the upcoming Yocto Project release codenamed Wrynose (expected in 2026). Beyond reducing technical debt, the refactoring will introduce unified testing procedures and streamlined porting guidelines. These enhancements are designed to improve overall consistency across supported hardware platforms and make it easier for contributors and users to extend RAUC support to new machines.
The community's input is highly valued: What best practices should be promoted? What features or improvements would you like to see in meta-rauc-community in the long term? Let’s start a discussion on how this layer can become even more helpful, maintainable, and future-ready - together.
🔍 Top 5 Qualities to Look for in Salesforce Partners in 2025
Choosing the right Salesforce partner is critical to ensuring a successful CRM transformation in 2025.
This guide highlights the best 10 free AI character chat platforms available today, covering a range of options from emotionally intelligent companions to adult-focused AI chats. Each platform brings something unique—whether it's romantic interactions, fantasy roleplay, or explicit content—tailored to different user preferences. From Soulmaite’s personalized 18+ characters and Sugarlab AI’s NSFW tools, to creative storytelling in AI Dungeon and visual chats in Dreamily, this list offers a diverse mix of experiences. Whether you're seeking connection, entertainment, or adult fantasy, these AI platforms provide a private and customizable way to engage with virtual characters for free.
Crazy Incentives and How They Kill Security. How Do You Turn the Wheel?Christian Folini
Everybody is driven by incentives. Good incentives persuade us to do the right thing and patch our servers. Bad incentives make us eat unhealthy food and follow stupid security practices.
There is a huge resource problem in IT, especially in the IT security industry. Therefore, you would expect people to pay attention to the existing incentives and the ones they create with their budget allocation, their awareness training, their security reports, etc.
But reality paints a different picture: Bad incentives all around! We see insane security practices eating valuable time and online training annoying corporate users.
But it's even worse. I've come across incentives that lure companies into creating bad products, and I've seen companies create products that incentivize their customers to waste their time.
It takes people like you and me to say "NO" and stand up for real security!
Integrating FME with Python: Tips, Demos, and Best Practices for Powerful Aut...Safe Software
FME is renowned for its no-code data integration capabilities, but that doesn’t mean you have to abandon coding entirely. In fact, Python’s versatility can enhance FME workflows, enabling users to migrate data, automate tasks, and build custom solutions. Whether you’re looking to incorporate Python scripts or use ArcPy within FME, this webinar is for you!
Join us as we dive into the integration of Python with FME, exploring practical tips, demos, and the flexibility of Python across different FME versions. You’ll also learn how to manage SSL integration and tackle Python package installations using the command line.
During the hour, we’ll discuss:
-Top reasons for using Python within FME workflows
-Demos on integrating Python scripts and handling attributes
-Best practices for startup and shutdown scripts
-Using FME’s AI Assist to optimize your workflows
-Setting up FME Objects for external IDEs
Because when you need to code, the focus should be on results—not compatibility issues. Join us to master the art of combining Python and FME for powerful automation and data migration.
Who's choice? Making decisions with and about Artificial Intelligence, Keele ...Alan Dix
Invited talk at Designing for People: AI and the Benefits of Human-Centred Digital Products, Digital & AI Revolution week, Keele University, 14th May 2025
https://www.alandix.com/academic/talks/Keele-2025/
In many areas it already seems that AI is in charge, from choosing drivers for a ride, to choosing targets for rocket attacks. None are without a level of human oversight: in some cases the overarching rules are set by humans, in others humans rubber-stamp opaque outcomes of unfathomable systems. Can we design ways for humans and AI to work together that retain essential human autonomy and responsibility, whilst also allowing AI to work to its full potential? These choices are critical as AI is increasingly part of life or death decisions, from diagnosis in healthcare ro autonomous vehicles on highways, furthermore issues of bias and privacy challenge the fairness of society overall and personal sovereignty of our own data. This talk will build on long-term work on AI & HCI and more recent work funded by EU TANGO and SoBigData++ projects. It will discuss some of the ways HCI can help create situations where humans can work effectively alongside AI, and also where AI might help designers create more effective HCI.
Digital Technologies for Culture, Arts and Heritage: Insights from Interdisci...Vasileios Komianos
Keynote speech at 3rd Asia-Europe Conference on Applied Information Technology 2025 (AETECH), titled “Digital Technologies for Culture, Arts and Heritage: Insights from Interdisciplinary Research and Practice". The presentation draws on a series of projects, exploring how technologies such as XR, 3D reconstruction, and large language models can shape the future of heritage interpretation, exhibition design, and audience participation — from virtual restorations to inclusive digital storytelling.
2. Ls command
• List Files using ls with no option
• ls with no option list files and directories in bare format where we
won’t be able to view details like file types, size, modified date and
time, permission and links etc.
3. • List Files With option –l
• Here, ls -l (-l is character not one) shows file or directory, size,
modified date and time, file or folder name and owner of file and it’s
permission.
4. • View Hidden Files
• List all files including hidden file starting with ‘.‘.
5. • List Files with Human Readable Format with option -lh
• With combination of -lh option, shows sizes in human readable
format.
6. • List Files in Reverse Order
• The following command with ls -r option display files and directories
in reverse order.
• Shows version of ls command
• Check version of ls command.
7. • Show Help Page
• List help page of ls command with their option.
8. pwd command
• pwd‘ stands for ‘Print Working Directory‘. As the name states,
command ‘pwd‘ prints the current working directory or simply the
directory user is, at present. It prints the current directory name with
the complete path starting from root (/). This command is built in
shell command and is available on most of the shell – bash, Bourne
shell, ksh, zsh, etc.
• Basic syntax of pwd:
#pwd[option]
9. • If both ‘-L‘ and ‘-P‘ options are used, option ‘L‘ is taken into priority. If no option is
specified at the prompt, pwd will avoid all symlinks, i.e., take option ‘-P‘ into account.
• Note: A ‘pwd’ command is often used without options and never used with arguments.
Options Description
-L (logical) Use PWD from environment, even if it contains symbolic links
-P (physical) Avoid all symbolic links
–help Display this help and exit
–version Output version information and exit
11. tty
• tty is a place where the running command runs.
13. • View Contains of Multiple Files in terminal
• In below example, it will display contains of test and test1 file in
terminal.
14. • Create a File with Cat Command
• We will create a file called test2 file with below command.
• Awaits input from user, type desired text and press CTRL+D (hold
down Ctrl Key and type ‘d‘) to exit. The text will be written
in test2 file. You can see contains of file with following cat command.
15. • Use Cat Command with More & Less Options
• If file having large number of contains that won’t fit in output terminal and screen scrolls up
very fast, we can use parameters more and less with cat command as show above.
• Display Line Numbers in File
• With -n option you could see the line numbers of a file song.txt in the output terminal.
16. • Display Multiple Files at Once
• In the below example we have three files test, test1 and test2 and
able to view the contains of those file as shown above. We need to
separate each file with ; (semi colon).
17. • Use Standard Output with Redirection Operator
• We can redirect standard output of a file into a new file else existing file with
‘>‘ (greater than) symbol. Careful, existing contains of test1 will be
overwritten by contains of test file.
#cat test > test1
• Appending Standard Output with Redirection Operator
• Appends in existing file with ‘>>‘ (double greater than) symbol. Here,
contains of test file will be appended at the end of test1 file.
#cat test >> test1
• Redirecting Multiple Files Contain in a Single File
• This will create a file called test3 and all output will be redirected in a newly
created file.
#cat test test1 test2 > test3
18. who command
• who command is a tool print information about users who are
currently logged in. who command only see a real user who logged
in.
$who [options] [filename]
19. whoami command
• whoami command is used both in Unix Operating System and as well
as in Windows Operating System.
• It is basically the concatenation of the
strings “who”,”am”,”i” as whoami.
• It displays the username of the current user when this command is
invoked.
• It is similar as running the id command with the options -un.
20. rm command
• To run rm command, type rm followed by filename. Please
remember, that by default rm will not ask any confirmation.
• Remove a file
# rm xyz.log
• Remove multiple file with specific extension
• If you have multiple file with the same extension and you want to
delete them, you can use this syntax :
# rm *.log
21. • Remove a directory
• Removing directory is a little bit tricky. If you are sure that the directory is
empty, then we can use -d parameter to remove it.
# rm –d documents/
• But when the directory is not empty, you have to empty the directory first, or
you can remove them recursively. To remove recursively, use -r or -R parameter.
# rm –r documents/
• Add interactive confirmation before deleting
• If you feel more comfortable to have interactive confirmation, you can use -
i parameter with rm command. Here’s a sample of deleting directory recursively
with interactive confirmation.
# rm –ri documents/
22. mkdir command
• Running mkdir without any parameter will create directory under the current
directory
• Create multiple directories
#mkdir aa bb cc
• Add directory include its sub-directory
• When you want to created a include its sub-directory, you will need to use -
p parameter.
#mkdir –p aa/bb
• Set access privilege
• Using -m parameter, we can also set the access privilege for the new directory on-
the-fly.
23. rmdir command
• rmdir [OPTION] {directory-name}
• To delete directory called foo
#rmdir foo
• Remove DIRECTORY and its ancestors
• For example remove directory structure sales/99/march
#rmdir –p sales/99/march
24. touch command
• The touch command is a standard command used in UNIX/Linux operating
system which is used to create, change and modify timestamps of a file.
#touch filename
• The file which is created can be viewed by ls command and to get more
details about the file you can use long listing command ll or ls -l command .
• Touch command to create multiple files: Touch command can be used to
create the multiple numbers of files at the same time. These files would be
empty while creation.
#touch file1 file2 file3
25. cd command
• Change from current directory to /usr/local.
• Change from current directory to /usr/local/lib using absolute path.
26. • Change from current working directory to /usr/local/lib using relative
path.
• Move one directory back from where you are now.
27. • Change Current directory to parent directory.
• Move to users home directory from anywhere.
28. cal command- display a calendar
• A single parameter specifies the 4 digit year (1 - 9999) to be
displayed. Two parameters denote the Month (1 - 12) and Year (1 -
9999). If arguments are not specified, the current month is
displayed. A year starts on 01 Jan.
31. • Create another text file called bar.txt
$ echo 'For desktop usage I prefer Apple OS X unix operating systems.' > bar.txt
• Display both files on the screen, enter:
$ cat foo.txt
$ cat bar.txt
• To append a contains of bar.txt to to foo.txt, enter:
$ cat bar.txt >> foo.txt
$ cat foo.txt
• To append a ‘Use unix or die’ text to foo.txt file, enter:
$ echo 'Use unix or die' >> foo.txt
$ cat foo.txt
33. cat command- concatenation
# sample.txt
This is a sample text file
# sample1.txt
This is a another sample text file
To concatenate two files.
$ cat sample.txt sample1.txt > sample2.txt
$ cat sample2.txt
This is a sample text file
This is a another sample text file
34. mv command
• mv stands for move. mv is used to move one or more files or directories from one
place to another in a file system like UNIX. It has two distinct functions:
(i) It renames a file or folder.
(ii) It moves a group of files to a different directory.
• No additional space is consumed on a disk during renaming. This command normally
works silently means no prompt for confirmation.
• Syntax:
mv [Option] source destination
$ mv geek.txt b.txt
35. • -i (Interactive): Like in cp, the -i option makes the command ask the user for
confirmation before moving a file that would overwrite an existing file, you have to press
y for confirm moving, any other key leaves the file as it is.
$ mv -i geek.txt b.txt mv: overwrite 'b.txt’? Y
• -b(backup): With this option, it is easier to take a backup of an existing file that will be
overwritten as a result of the mv command. This will create a backup file with the tilde
character(~) appended to it.
$ mv -b geek.txt b.txt
• –version: This option is used to display the version of mv which is currently running on
your system.
$ mv --version
36. cp command- copy one or more files to another location.
• Copy sample.txt to sample.bak
$ cat sample.txt
This is a sample file
$ cp sample.txt sample.bak
$ cat sample.bak
This is a sample file
• Copy sample directory to home directory
$ cp -f /user/sample/* >
37. man command
• man command in Linux is used to display the user manual of any
command that we can run on the terminal. It provides a detailed
view of the command which includes NAME, SYNOPSIS,
DESCRIPTION, OPTIONS, EXIT STATUS, RETURN VALUES, ERRORS,
FILES, VERSIONS, EXAMPLES, AUTHORS.
• Syntax :
$man [OPTION]... [COMMAND NAME]...
eg.
$ man printf
40. chmod command
• In Unix-like operating systems, the chmod command is used to change the access
mode of a file.
• The name is an abbreviation of change mode.
• The references are used to distinguish the users to whom the permissions apply i.e.
they are list of letters that specifies whom to give permissions. The references are
represented by one or more of the following letters:
• Reference Class Description
u owner file's owner
g group users who are members of the file's group
o others users who are neither the file's owner nor members of the
file's group
a all All three of the above, same as ugo
41. • The operator is used to specify how the modes of a file should be adjusted. The
following operators are accepted:
• Operator Description
+ Adds the specified modes to the specified classes
- Removes the specified modes from the specified classes
= The modes specified are to be made the exact modes for the
specified classes
• The modes indicate which permissions are to be granted or removed from the specified
classes. There are three basic modes which correspond to the basic permissions:
r Permission to read the file.
w Permission to write (or delete) the file.
x Permission to execute the file, or, in the case of a directory, search it.
42. • change the assgn1_client.c permission so that the owner cannot
write(w) in the file but can only read it.
BEFORE: -rw-rw-r-- mik mik assgn1_client.c
COMMAND: chmod u=r assgn1_client.c
AFTER: -r--rw-r-- mik mik assgn1_client.c
43. grep command
• The grep filter searches a file for a particular pattern of characters,
and displays all lines that contain that pattern. The pattern that is
searched in the file is referred to as the regular expression (grep
stands for globally search for regular expression and print out).
Syntax:
# grep [options] pattern [files]
45. $cat > geekfile.txt
unix is great os. unix is opensource. unix is free os.
learn operating system.
Unix linux which one you choose.
uNix is easy to learn.unix is a multiuser os.Learn unix .unix is a powerful.
Case insensitive search : The -i option enables to search for a string case insensitively in the give
file. It matches the words like “UNIX”, “Unix”, “unix”.
$grep -i "UNix" geekfile.txt
Output:
unix is great os. unix is opensource. unix is free os.
Unix linux which one you choose.
uNix is easy to learn.unix is a multiuser os.Learn unix .unix is
46. • Displaying the count of number of matches : We can find the number of lines that matches the
given string/pattern
$grep -c "unix" geekfile.txt
Output:
2
• Display the file names that matches the pattern : We can just display the files that contains the given
string/pattern.
$grep -l "unix" *
or
$grep -l "unix" f1.txt f2.txt f3.xt f4.txt
Output:
geekfile.txt
47. tput command
• tput utility uses the terminfo database to make the values of terminal-dependent capabilities and
information available to the shell, to initialize or reset the terminal, or return the long name of the
requested terminal type.
• Set the Cursor Position using tput cup
$ tput cup 2 3
• Clear the Screen Using tput clear
$ tput clear
• Get the Number of Columns and Lines of a Terminal
$ tput cols
• displays number of lines of your terminal screen
$ tput lines
• Change the Terminal Background Color using tput setb
$ tput setb 4
48. bc command
• bc command is used for command line calculator. It is similar to basic calculator by using which we can
do basic mathematical calculations.
• Arithmetic operations are the most basic in any kind of programming language. Linux or Unix operating
system provides the bc command and expr command for doing arithmetic calculations. These
commands are used in bash or shell script also for evaluating arithmetic expressions.
Syntax:
bc [ -hlwsqv ] [long-options] [ file ... ]
Options:
-h, {- -help } : Print the usage and exit
-i, {- -interactive } : Force interactive mode
-l, {- -mathlib } : Define the standard math library
-w, {- -warn } : Give warnings for extensions to POSIX bc
-s, {- -standard } : Process exactly the POSIX bc language
-q, {- -quiet } : Do not print the normal GNU bc welcome
-v, {- -version } : Print the version number and copyright and quit
49. • The bc command supports the following features:
• Arithmetic operators
• Increment or Decrement operators
• Assignment operators
• Comparison or Relational operators
• Logical or Boolean operators
• Math functions
• Conditional statements
• Iterative statements
50. $ echo "12+5" | bc
Output
17
$ echo "10^2" | bc
Output
100
$ echo "var=10;var" | bc
Output
10
Assign 10 to the variable and print the value on the terminal.
$ echo "var=10;var^=2;var" | bc
Output
100
Squares the value of the variable and print the value on the terminal.