Linux Getting Started Guide

Because of the recent courses on operating system need to use Ubuntu operating system, but do not use the Linux operating system experience before most of the students, so I'll briefly put together a Linux Getting Started Guide for everyone to learn.

Linux version

I believe many students will have this doubt, in the end is what to do with it, want to explain their relationship, I have to mention the version of Linux operating system between Ubuntu and Linux operating systems we use.

Linux versions can be divided into the kernel version and release , they are defined as follows:

Linux kernel version: The kernel is the heart of the system is the core program run programs and manage hardware devices, it provides an abstraction layer between the bare device and application. The Linux kernel version is divided into the stable version and the development version . Stable industrial strength, can be widely used and deployed new stable version is only relative to the old modify some bug or add some new drivers; Developer Edition because you want to test a variety of solutions, so it's quite a change fast.

Linux distributions usually contain desktop environment, media players, database and other application software. We are familiar with Ubuntu, Fedora, KaliLinux are all distributions of Linux.

Linux directory structure

First, some Windows and Linux file system differences: Windows have multiple drive letters, and each drive has its own root directory structure. As shown below:

Windows structure
And Linux is no concept of letter, only a root directory / , all files below it.
Linux
A brief overview of the following functions root directory folder:
This is also how the watermark
bin: put the relevant contents of the program (the installation program will put here)
the Boot: boot and related
cdrom: CD associated with
hardware-related equipment: dev
etc: the program / server configure the relevant
lib: library
home: the user's operating primarily in the home folder
Note: in addition to home files, other files and folders are not the best to make changes, it may cause not boot ( Do not ask how I know of )

Linux command

The following text into the
Linux command format (command is required, the rest is optional): command (command) [-options] (option) [parameter1] (parameters) ...

Path command:

ls:显示当前路径(文件夹)的所有文件与文件夹
ls / :显示根目录(/)下的文件与文件夹
ls /bin :显示根目录下的bin内的文件与文件夹
显示其他目录下的文件与文件夹同理
ls –a :显示包含隐藏文件在内的所有文件(隐藏文件的开头是“.”)
ls –l :以列表方式显示
pwd:显示当前路径

Change directory cd (change directory):

cd 当前文件夹下目录名 :切换为指定目录
cd - :回到上一次所在的路径
cd ~ :回到家目录(和登录用户名相同的文件夹,不是home)
cd ..:切换到上一级目录

Files and folders command:

touch 文件名 :创建一个文件
mkdir 文件夹名:创建一个文件夹
gedit 文件名:编辑文件内容
cat 文件名:查看文件内容(cat可以通过重定向将两个文件合并为一个文件)
more 文件名 :分屏查看文件内容(按‘q’退出)
mv 原来文件名字 修改之后的名字 :将文件进行重命名
mv 文件名 文件夹名:将指定文件移动到指定文件夹中
rm 文件名:删除文件(删除文件夹要在后面加‘-r’)
rmdir 空文件夹名:删除空文件夹
ln –s 已经存在的文件名 新的文件名 : 对一个存在的文件建立软连接(相当于快捷方式,原文件删除后该文件无法使用)
ln 已经存在的文件名 新的文件名 :对一个存在的文件建立硬连接(原文件删除后该文件仍可以使用)
cp 文件名 文件夹名 :将指定文件复制到指定文件夹中(加-r可以将文件夹复制到文件夹中,-r位置在cp后或总命令后均可)
grep “关键字” 文件名:在指定文件里搜索含有指定关键字的信息
find +目录名 + -name +“文件名”(可用通配符)  : 从指定目录中查找名字与搜索文件名相关的文件 (区分grep,grep是从指定文件中查找文件的内容)

Process command:

ps –aux :显示当前全部进程
kill PID(一个进程有一个单独的PID) :结束指定进程
kill -9 PID:强制结束指定进程

Other commands:

clear:清屏
history :查看历史命令
>(或>>):重定向 (具体原理下面会说)
tar -cvf 包名.tar 要打包的文件名(一个或多个) :将指定文件打包(默认打包到当前文件夹)
tar -xvf 指定包名.tar :将指定包解开(默认解到当前文件夹)
ifconfig :查看或配置网卡信息
ping 局域网中其它的电脑ip :查看与局域网中其他电脑是否存在网络连接
sudo useradd 用户名 -m :创建一个用户名(有-m则创建一个家目录)
sudo passwd  用户名 :更改指定用户名的密码
su - 用户名 :切换到指定用户名
cal :显示本月日历
date :查看当前时间

Additional information:

Ubuntu help document View:

Command + "-help" Example: ls --help
or: man + command Example: man ls

Autocomplete:

tab: win their first letters by the command tab, the system will automatically help us to complete the command.

Wildcard:

Wildcards are a special statement, mainly with an asterisk (*) and question mark (?), Fuzzy search for files. When looking for a folder, you can use it to replace one or more real characters.

Redirect

URL redirect tutorial

These are this week's update, what questions are welcome in the comments area proposed, the author of this article is @Dger, thank you for watching.

Released two original articles · won praise 1 · views 82

Guess you like

Origin blog.csdn.net/geekctwd/article/details/105346456