Вы находитесь на странице: 1из 24

CHAPTER 1: LINUX OPERATING SYSTEM

A bit of history
What is Linux? A short answer to this question is "a computer operating system based on
Linux kernel and GNU tools and libraries". In order to understand what Linux is, first we need to
know different concepts such as Linux, kernel, and GNU. Formally, Linux is not an operating
system. It's just a software component working as a bridge between applications and the data
processing done by the hardware. Because of this fact, the kernel is the core component of an
operating system. First Linux kernel was written by Linus
Torvalds in 1991. Usually, the term Linux is used to refer to a
whole operating system based on the kernel. However, an
operating system needs more components to be complete. At this
point, there are a number of operating system based on Linux
kernel, plus a set of tools provided by the GNU open source
project.
What are GNU tools? Well, first of all we should learn
about the GNU project. Basically, this is an open source project
started by Richard Stallman with the goal of building a set of
software components and tools to avoid the use of any software
that is not free. Now that we've learned about Linux, kernel, and
GNU, we can define a distribution as a composition of Linux
kernel and GNU tools and other useful software. We've just
Linux mascot: Tux the penguin
mentioned a new conceptdistribution. Have you heard about
Ubuntu, Fedora, or Debian? These three are examples of Linux
distributions. A Linux distribution can be defined as a whole operating system providing a kernel, a
system of base tools, and a complete set of applications ready to use for users. This guide is based
on Linux Mint, a distribution that started back in 2006 with a goal to be fully usable on the desktop
computers.

What is open source?


Linux is an open source project supported by hundreds of volunteers and contributors. This
means that people work together sharing ideas, writing tutorials, discussing in forums, and
developing software. The final result is not only the Linux distribution, but a lot of documentation is
generated as well. Collective intelligence allows us to build one of the most used operating systems
in the world. We cannot forget that Linux operating system (OS) is open source, and it's released
under the popular General Public License (GPL) software license. All people contributing to Linux
project make up the community.
In the open source world, a community is a set of users and developers supporting a specific
project. Everyone can contribute to a Linux project in different ways and that's the magic of open
source projects, where the job of each person matters. The first area is for those who want to
develop software, write documentation, make artwork, or report bugs. However, non-technical
people can contribute to this area as well, for instance, they can make translations to get more and
more languages supported. The promotion of the project and distribution can be for those who are
interested in helping others, writing articles, or organizing local presentation for spreading the
knowledge.

CHAPTER 2: INSTALLING LINUX MINT


Boot process, partitions and mounting
A typicall boot process of every operating system consist of a few steps:

Majority of Linux distributions use a boot loader named GRUB (Grand Unified Boot Loader)
which handles booting different OSes from different hard drives, partitions and file systems. Boot
loader is a piece of software usually installed in the first 512KB of the Master Boot Record (MBR)
on the first hard drive. As you know, hard drives are divided into partitions and each partition uses a
file system. Linux OSes name physical hard drives as SDA, SDB, SDC and so on, where SDA is
the first physical disk, SDB is the second physical disk etc. S in the name stands for SATA, D
for the disk. When we add partitions to the mix numbers are added. So, the first partition on the first
hard drive is SDA1, second partition will be named SDA2 and so on. Following this convention
you can easily know that the fourth partition on the third disk will be named SDC4.
All partitions are attached to the system via a mount point. The mount point defines the
place of a particular data set in the file system. Mount points are directories. These empty
directories will be the starting point of the partitions that are attached to them.
Linux distributions also use a different partition mounting scheme than Windows. In a
Windows installation you typically have C and D partitions; first one for the OS itself, and the
second for user data. Linux installation also uses two partitions. Root partition, mounted to / , is
where the system is installed, while the other partition which is mounted to /home is the place for
each users data files and software preferences. In addition to root and home partitions, sometimes a
swap partition is needed, typically for systems with 1GB or less of RAM. Swap partition is used as
a virtual memory when the OS runs out of physical RAM. On Windows OSes this is known as the
page file.
Windows
Physical location

Name

Linux
Mount point

Name

Mount point

First hard drive, first partition

disk(0)rdisk(0)partition(1)

sda1

First hard drive, second partition

disk(0)rdisk(0)partition(2)

sda2

/home

Comparison between Windows and Linux HDD naming schema


A file system is used to control how data is stored and retrieved. Without a file system,
information placed on a hard disk would be one large body of data with no way to tell where one
piece of information stops and the next begins. By separating the data into individual pieces, and
giving each piece a name, the information is easily separated and identified. Windows typically uses
NTFS and FAT32 file systems, depending on the size of the disk. Linux supports a wide range of
file systems, some of which are used more often than the others. Most widely used file system on
Linux is EXT4, preceded by EXT3. Future kernel version feature a new file system called BTRFS
with some advanced algorithms and techniques for storing and retrieving data.

Editions
As other operating systems, Linux Mint has different editions or
flavors. Basically, we can find two main editionsone based on Debian,
which is called Linux Mint Debian Edition (LMDE), and another one
based in Ubuntu. In addition to Ubuntu and Debian software repositories,
Linux Mint uses its specific ones. LMDE is a rolling release. This means
the distro constantly receives updates without generating releases.
However, releases for the regular Mint edition (the one based on Ubuntu
which we will use) are only generated by following a specific period of
time. Despite LMDE being faster and more responsive than Linux Mint,
non-advanced users should think again before using it because continuous
updates can bring some errors that they might find difficult to solve.

Linux Mint logo

On the other hand, Linux Mint is easy to maintain and was designed to offer an unbeatable
user experience.The Linux Mint project distributes each edition through different ISO images, each
being ready to be burned on a DVD. Regarding the regular edition of Linux Mint, we can find eight
different ISO images. Well, we only have four that are really different, because each one has its own
equivalent in 32b and 64b. Four different desktop environments are includedMATE, Cinnamon,
KDE, and Xfce. This guide will focus on Linux Mint 64bit with Cinnamon desktop environment.

Hardware requirements
Device

Minimum

Optimal

CPU

1GHz 32bit

1GHz 32bit

RAM

512MB

1GB

HDD

8GB

8GB

VGA

2D, 800 x 600 resolution

3D, 1024 x 768 resolution

Creating a bootable USB drive


1. Download Linux Mint 16 from this link: goo.gl/Z3XIPW
2. Download Unetbootin from this link: unetbootin.sourceforge.net
3. Open Unetbootin, choose Disk
image and browse to downloaded
ISO file
4. Choose your USB drive carefully
and click OK. After a few minutes
USB drive will be ready and
bootable

Installation
1. Reboot your computer and select your USB drive as the device for booting.
2. After boot you should see a screen like this. Press Enter and allow it to finish booting

3. After bootup is finished you should see a desktop like this. Linux Mint is usable as a
LiveCD which means it can be used directly from USB or CD drive without installation

4. Double click Install Linux Mint icon and choose your language options

5. Next screen will make sure that your computer can install and run Linux Mint

6. This screen lets you choose installation type. First option will erase your entire HDD and
automatically create partitions. We don't want that, so choose Something else which lets
you create the partitions manually

7. On this screen choose New partition table and proceed with Continue when prompted.
Create two partitions as noted in the introduction: one for the system (root partition) and one
for user data (home partition) like in the picture below. Note the boot loader installation path
is /dev/sda which is the MBR of the first hard drive

8. Next screen will automatically set your timezone, change if needed

9. After time zone, choose your keyboard layout, as in the picture below

10. Last step allows you to enter your name, username and your password

After a few minutes the setup will finish installing Linux Mint and offer you to restart your system.
Boot from the first hard drive and choose Linux Mint from the GRUB boot loader. Login screen
will prompt for your password

CHAPTER 3: CONFIGURING LINUX MINT


The Control Center
Control Center is an integrated software tool that provides access to many useful
applications for configuring different aspects of your operating system, like the Control Panel on

Windows. The tools are grouped into different sections, namely Appearance, Preferences,
Hardware and Administration. To access it, click the Menu button and then click System
Settings in the upper left portion of the menu.

Changing display resolution

Open the Control Center and type resolution in the search box in the upper right corner,
then click the Display icon and confirm with Apply.

Wired network settings


Nowadays, computers work together through network-sharing resources such as files,
folders, and printers. In fact, the Internet is a huge network where computers are working to
exchange data. In order to be able to participate in this exchange an IP address is needed. There are
two ways to get an IP address automatically by using a DHCP server, and manually. Lets
configure our network for automatic IP address:
1. From Control Center open Networking
2. Open Wired network options and navigate to IPv4 settings
3. Set Method to Automatic (DHCP)

Your computer will be assigned a new IP address from a local pool of available addresses when a
network is configured in this way.

Wireless network settings


Confguring a wireless network is very similar to wired network configuration with some
security settings added.. These are accessed by clicking 802.1x Security tab and choosing the
apropriate security method such as WPA2. Be sure to configure your wireless router in the same
way.

Sharing resources with Windows users


Shared resources, also known as network resources, refer to computer data, information, or
hardware devices that can be easily accessed from a remote computer through a local area network
(LAN). Shared resource access allows users to operate as if the shared resource were on their own
computer. The most frequently used shared network environment objects are files, data, multimedia
and hardware resources like printers and scanners. Sharing resources over network between Linux
and Windows machines works over SMB protocol (pronounced Samba). Samba is officially
supported on every Linux distribution, various UNIX distributions and Windows since Windows
Millenium. Since version 4 Samba can act as a primary or secondary domain controller in an Active
Directory environment.
To access a Windows share on your network, open the Nemo file manager and locate
Network section in the Locations pane on the lower left:

A prompt will ask for a password of the user account on the Windows machine. Password must be
enabled for that account if the account is administrative. You can see all the shares enabled on the
Windows machine when you enter the right password.

Changing your password


When an administrative user creates another user account that account is assigned with some
password. To change your password open the Control Center, click Account details and then click
the password field. Another window will open requiring you to enter the current password and the
new password twice.

CHAPTER 4: USER AND GROUP MANAGEMENT


Who am I?
A user account is required for accessing Linux Mint. Actually, when you installed the
operating system you typed some data about a user and the account was created. Sometimes it is
needed to add or remove a user, or become another user with elevated privileges. This chapter will
explain how to add or remove users, manage user privileges and become the super user.

Users
Linux was built as a multiuser operating system. Each Linux distribution has at least two
users by default, a regular user and a super user called root. This is a special user of the operating
system that is used by the system administrator. The root user has all kinds of permissions over files
and programs. Actually, some specific operations can only be executed through this user. Linux
Mint doesn't enable the root user by default. However, Mint uses special commands that allow users
to become the root user. This means that regular users can execute actions that were initially
reserved for the root user. Also, Mint configures the sudo command (super user do), allowing the
user created during the installation process to become the root user. You were doing some actions as
the root user in the previous chapter while installing and removing packages. That is why you had
to input the password before executing any action that would alter the system.

Adding a user
As we said before, Linux was built as a multiuser operating system where each user has a set
of permissions over files and directories. Lets add another user account. Click the Menu button and
type users in the search box. Search results will offer you to run Users and groups application.
Run it, type your password and click the Add button to add another user account.

There are two types of user accounts on Linux Mint, standard and administrator. A standard
user can't use sudo privileges while an administrator user can. The first user created during the
installation is an administrator user. Now, add a standard user with a password.

Adding a new group


On Linux systems, users can be categorized into groups. A group is a set of users who share
permissions. For example, a specific group can have access to certain directories. This means that
all users belonging to that group can access these specific directories. Linux Mint uses many groups
by default; some of them are audio, backup, and games. Also, it's possible to create additional
custom groups. The window for creating a new group allows us to choose a group name. Every
group on Linux systems has an ID number which identifies each group and must be different for
each group created in the system. Linux Mint will choose a group ID by default for every new
group, but you can choose a different number as well. Let's add a group using the same tool we used
for adding users as seen in this picture. Click the Groups tab and then click the Add buton. A small
dialog will appear asking for the name of the new group. Type pravnici and click Ok.Adding a
user to a group
Users and groups window allows us to add a user to a group. Select the user named
Marica and click the Groups button to display a list of all groups to which Marica belongs to.
Creating the group will automatically create the group with the same name, so the user Marica
will be a member of the group named marica. Check the boxes like in the picture below to add
user Marica to groups pravnici and sudo.

Adding this user to the sudo group effectively makes the user an administrator. Be carefull about
this, not everyone should be allowed to change the system configuration.

CHAPTER 5: INSTALLING, REMOVING AND UPGRADING


SOFTWARE
Installing software
Sooner or later, you will want to install some additional software. In fact, this is one of the
most common tasks for the users. Linux Mint includes thousands of software applications that can
be installed easily. Remember that when you install the operating system, a lot of software is
installed by default. Also, it's possible to install additional software provided by Linux Mint. In
order to facilitate the process of installing software in Linux Mint, this operating system includes a
tool named Software manager. Click the menu button in bottom left corner, hover to
Administration and select Software manager as shown in the picture below.

Running Software manager


Authentication is required in order to run an application that will alter the operating system itself,
such as installing or removing software. When you run Software manager a password prompt will
appear. Enter your password that you chose while installing. If you entered the password correctly a
window will open like the one in the picture above.

Linux Mint comes with default applications for internet, multimedia, office and graphics
installed. Let's install SMPlayer instead of default VLC Media Player. Locate the search field in the
upper right corner of Software manager and type smplayer. After a few moments a list will appear
containing every software package related to the search term.

Software manager search results

Double click the first item as shown in the picture above, after which info page appears.

Clicking Install will download and install SMPlayer.

Linux distributions include a lot of software that is ready to be installed in a specific format
called a package. Software is organized in different packages and some applications need more than
one package; this fact is called package dependency. Linux Mint uses packages in the Debian
(DEB) format, same as the Ubuntu Linux and Debian operating systems. Packages are usually
retrieved and installed from an internet location. This location is called a repository, and it contains
many software packages ready to be downloaded and installed in your machine. Software Manager
is an application developed by Linux Mint developers specifically for LinuxMint. This tool allows
you to list, install, and remove software. Technically, Software Manager is a frontend for some
commands, such as apt-get and apt-cache. Using a GUI, Software Manager provides an easy and
intuitive way to list, install, and remove software, avoiding the use of the command-line interface.
We've installed SMPlayer, a simple but powerfull multimedia player. As you must have
discovered, it's pretty easy to install software through packages provided by Linux Mint. You only
need to search for a software package and click on the Install button. Obviously, you can install a lot
of different software on your machine following the same process. It's important to know that not
only software distributed in packages can be installed in Linux Mint. However, Mint includes a lot
of software distributed in DEB packages, so this method of installation is advisable. Actually, it's
good practice to use Software Manager to install software on your Linux Mint operating system.
Have a go discover software provided by Linux Mint. When you launch Software Manager, a
window showing you different icons will be displayed. Each icon represents a different category of
software included in Linux Mint. For example,you can see the Internet, Sound and Video, Graphics,
and Office categories, among others. By clicking on each one, you'll have access to packages
belonging to the selected category. You can try and click on a category, take a look at the list of
packages for that category, and try to install one of the packages. This process allows you to
discover interesting software that can be installed on your machine.

Removing software
Previously, we learned how to install software on your Linux Mint machine. Also, it's
interesting and useful to know how to do the opposite step. You can remove installed software on
your machine by following a simple process using the Software Manager tool. Remember that you
can remove software installed by default during the installation process of the operating system or
remove software that you have installed through the Software Manager application.
Similarily to the previous process, open Software manager, search for VLC, double click the
first item and click Remove button.

Updating software
Between the release cycles, Linux Mint developers update some software that is included in
the operating system. This means that the user should check what software has been updated and
they should decide which of this software should be installed on the machine. Occasionally, updated
software only applies minor changes, such as
simple improvements or unimportant bug fixes.
However, at times updated software also
includes important security bug fixes. If we don't
apply them, our machine can be at a serious risk.
That's the reason we frequently check which
software has been updated for our Linux Mint.

Update Manager is an effective application provided by Linux Mint to install new versions
of installed software and to install security updates on your machine. When you launch that
application the first time, you will see only a single item in a list for applying upgrades. This item
indicates that you need to install an upgrade for mintupdate, which is the codename of Update
Manager. Obviously, before applying other upgrades, we need to upgrade the tool itself. Once this
process is finished, Update Manager will be launched again to check which software can be
updated.
The list of software ready to be updated displays different items providing information about
the package name, installed version, and new version available. Also, a number for each item is
displayed. This number ranges from 1 to 5, and it indicates a level based on the importance of the
upgrade. Level 1 indicates that Linux Mint developers certify that a package and packages marked
with this level should be upgraded as soon as possible.Usually, security updates use this level. The
next level is for those packages whose upgrade is recommended by Linux Mint developers. Level 3
indicates that it is safe to apply an upgrade, but Linux Mint developers didn't test it. Packages
marked with level 4 are unsafe, and if you upgrade it, the stability of the system can be affected.
Finally, level 5 is for dangerous packages (in the unstable stage of development or with broken
dependencies), and Linux Mint developers know that they can damage the operating system.
In general terms, it's a good idea to launch the Software Manager frequently and upgrade
only those packages marked as level 1 and level 2. For levels 3, 4, and 5, system administrators and
advanced users should decide about applying upgrades or not themselves. Also, you can mark all
the packages listed or only a few of them. By default, only packages from level 1 to 3 are displayed
in the list for upgrading. You can change this preference by going to Edit | Preferences.
To update your system follow these simple steps:
1. Run Update manager by clicking on Menu, hovering over Administration and clicking
Update manager in the right pane
2. Enter your password to authenticate and change the system configuration
3. After the initial refresh, click Install updates to update the mintupdate package

4. A list of all packages that can be updated will be shown after updating mintupdate Again,
click Install updates to update the whole system.

CHAPTER 6: COMMAND LINE INTERFACE


Introduction to the command line
A command-line interface, also known as command-line user interface is a means of
interacting with a computer program where the user issues commands to the program in the form of
lines of text (command lines). Command-line interfaces are often preferred by more advanced
computer users, as they often provide a more concise and powerful means to control a program or
operating system. Programs with command-line interfaces are generally easier to automate via
scripting.
Operating system (OS) command line interfaces are usually distinct programs supplied with
the operating system. A program that implements such a text interface is often called a commandline interpreter or shell. The term 'shell' can be in principle any program that constitutes the userinterface, including fully graphically oriented onesfor example, the default Windows GUI is
created by a shell program named explorer.exe. Examples of command-line interpreters include the
various Unix shells (sh, ksh, csh, tcsh, bash, etc.), the historical DOS command.com and the
Windows cmd.exe programs.

Anatomy of a command line


Every command line interface, or the shell, consists of two components. First part is the
prompt and the second part are user entered commands. In a Windows environment a prompt is
usually the current directory, for example C:\. On Linux systems this prompt is similar to
user@hostname$ (that's how email addresses were created), for example ivica@mintbox. As you
can see, this prompt consist of currently logged in user followed by the machine hostname. Dollar
sign means that the user is a regular user and not the root user. Root users have their command
prompt followed by #, for example root@mintbox#.

Executing commands
Linux Mint provides an easy to use shell interpreter called the Terminal. Launch it and note
the prompt, similar to the one in the picture:

Tips and tricks


It is valuable to know a few things before adventuring into shell commands and scripting:
1. Linux is case sensitive; documents is not the same as Documents
2. TAB key is very useful because it completes commands, including programs, directory or
file names. Just type a few starting letters and press TAB. For example, if there are multiple
commands starting with to like touch and totem then press TAB twice to see all the
suggestions.

Moving around the directory tree


Shell can sometimes be hard to comprehend and to navigate, so it is usefull to know where
we are now in the directory tree. Printing the current working directory is done by executing pwd
(print working directory). Output should be similar to
ivica@ivica-VirtualBox ~ $ pwd
/home/ivica
which represents the user's home directory. To change the current directory simply type
ivica@ivica-VirtualBox ~ $ cd Documents
ivica@ivica-VirtualBox ~/Documents $
cd stands for change directory. Notice how commands are abbreviated from the actions themselves?
If you are to type pwd now and check the current working directory, this would print out:
ivica@ivica-VirtualBox ~/ Documents $ pwd
/home/ivica/ Documents
Notice that the prompt changed it now includes the name of the current working directory,
Documents. In addition to it, there is an ~ simbol (tilda). This symbol represents the user's home
directory and is widely used whenever possible. For example, if you are on some long path like
/home/ivica/some/long/path/to/a/directory and want to go back to your home directory simply type
cd ~ and it will return you there. If you wanted to go back just one directory cd .. (note the two
dots) will do that for you. Going two directories back is done by executing cd ../.. and so on.

Creating directories and files


Creating a new directory is easy. Let us create a new directory called podaci:
ivica@ivica-VirtualBox ~ $ mkdir podaci
mkdir stands for make directory. It is also possible to create new directories on a path, like this:
ivica@ivica-VirtualBox ~ $ mkdir -p slike/nove

This command will act in two ways:


1. if the directory slike exists, the subdirectory nove will be created;
2. if the directory slike does not exist, it will be created, followed by creation of the
subdirectory nove;
To create a text file use the touch command:
ivica@ivica-VirtualBox ~ $ touch fajl.txt

Listing directories and files


To list directories in the current working directory run the ls command, which stands for
list:
ivica@ivica-VirtualBox ~ $ ls
Desktop

Downloads Pictures Public

Documents Music

podaci

Videos

Templates

The ls is a simple listing which shows only the name of the files and directories which are not
hidden. To show hidden files and directories add the -a command switch. Note that hidden
directories have a dot in front of the name, .dbus for example.
ivica@ivica-VirtualBox ~ $ ls -a
.dbus
Desktop

.bash_history

.gksu.lock

Pictures

.vboxclient-clipboard.pid

gnome2

podaci

.vboxclient-display.pid

.dmrc

.ICEauthority

.profile

Use the cat command to view the contents of a text file:


ivica@ivica-VirtualBox ~ $ cat fajl.txt
Ovo je reenica iz fajla "fajl.txt".

Deleting directories and files


So far we have created and listed directories and files from the command line. Deleteing
files and directories is equally simple as creating them. Command rm which stands for remove
will remove any file. Let's delete a file named fajl.txt to see rm in action:
ivica@ivica-VirtualBox ~ $ rm fajl.txt
There was no output from the shell which means that the fajl was deleted successfully. If we were to
repeat that command now it would throw an error that the file is missing:
ivica@ivica-VirtualBox ~ $ rm fajl.txt
rm: cannot remove fajl.txt: No such file or directory

Most Linux shell commands also accept wildcards such as asterisk (*) or a question mark (?). An
asterisk replaces any number of characters. We have a directory with many different files, as seen
by executing ls:
ivica@ivica-VirtualBox ~/podaci $ ls
slika2.jpg slika5.jpg tekst11.txt tekst1.txt tekst4.txt
slika3.jpg slika6.jpg tekst12.txt tekst2.txt tekst5.txt
slika4.jpg tekst10.txt tekst13.txt tekst3.txt tekst6.txt
To delete all the pictures from a directory in bulk (not one by one) you would simply execute:
rm *.jpg
This command can be loosely translated as delete every file with any name that has any number of
characters if the extension is jpg. Listing the files again will show that only pictures were deleted:
ivica@ivica-VirtualBox ~/podaci $ ls
tekst10.txt tekst12.txt tekst1.txt tekst3.txt tekst5.txt
tekst11.txt tekst13.txt tekst2.txt tekst4.txt tekst6.txt
Another wildcard, a question mark, is used to replace exactly one character. A simple example
would be to delete the files that have a name with two digits in it, namely tekst10.txt, tekst11.txt
and so on.
ivica@ivica-VirtualBox ~/podaci $ rm tekst1?.txt
The command shown above would delete files tekst10.txt tekst12.txt tekst11.txt tekst13.txt.
Directories can be deleted in a similar manner, except for when they are not empty. Non empty
directories must be deleted recursively, i.e. from the bottom of the directory tree up from last file
up to the directory itself. This can be done with passing an extra argument to the rm command:
ivica@ivica-VirtualBox ~ $ rm podaci/
rm: cannot remove podaci: Is a directory
When we add the -r argument the directory will be deleted:
ivica@ivica-VirtualBox ~ $ rm -r podaci/
Again, there was no output which means that there was no error and the command executed
successfully.

Copying, moving and renaming files and directories


In order to copy a file you need to provide it's source and destination path to the cp
command. Since the file nova_slika.jpg is in the current directory we just have to type it's name
and add the destination which in this case is the directory slike:
ivica@ivica-VirtualBox ~ $ cp nova_slika.jpg slike/
No output indicates that the picture was successfully copied. To copy a directory you must add an
recursion argument, -r to copy the directory with all the files in it.
ivica@ivica-VirtualBox ~ $ cp -r nove slike slike/
Moving and renaming files shares the same syntax, and if you think about it it makes sense.
Command that is used is mv, short for move. Source and destination are required, as with
copying. There is a directory named podaci in the current directory. Let's change it's name to
tekstovi:
ivica@ivica-VirtualBox ~ $ mv podaci/ tekstovi
ivica@ivica-VirtualBox ~ $ ls
Desktop

Downloads Public

tekstovi

Videos

Summary of commands used in this chapter


Action

Command

Usage

Example usage

pwd

pwd

pwd

Change directory

cd

cd directory name

cd Documents

Create a directory

mkdir

mkdir directory name

mkdir slike

Create a file

touch

touch file name

touch imenik.txt

List directory

ls

ls directory name

ls slike/

Show file contents

cat

cat file name

cat fajl.txt

Delete a file

rm

rm file name

rm fajl.txt

rm -r

rm directory name

rm -r Documents

Copy a file

cp

cp source destination

cp nova_slika.jpg slike/

Move a file

mv

mv source destination

mv nova_slika.jpg slike/

Copy a directory

cp -r

cp -r source destination

cp -r slike/ Documents

Move a directory

mv

mv source destination

mv podaci/ slike/

Rename a file or directory

mv

mv old-name new-name

mv podaci/ tekstovi/

Show current directory

Delete a directory

Вам также может понравиться