Linux基础知识 - Something TO DO

Linux基础知识

Something TO DO posted @ 2014年5月11日 22:42 in Ubuntu with tags linux 基础知识 , 1311 阅读

总结Linux学习中会经常用到又容易忘记的一些小知识

 

1、在纯文本界面下,中文会呈现乱码,如果想要让系统的默认的语系变成英文的话,那么可以修改系统配置文件

【/etc/sysconfig/i18n】。

2、改变用户(用于切换普通用户和root)

sudo su

3、一个文件下ls -al得出的文件描述为:drwxr-xr-- 1 test1 testgroup 5238 Jun 19 10:25 groups/

对于testgroup组之外的other用户权限中【r--】虽然有r,但是由于没有x的权限,因此others的使用者,并不能进入此目录!

4, 下载软件中心的软件所用指令:

sudo apt-get install *****(软件名称)

5,在linux下访问windows盘的内容:

cd /media/***/~~~

其中,***为用户名,~~~为盘符名称

6,  Ubuntu升级出现/boot空间不足解决方法 [1]

可以通过“ls /boot”命令查看/boot中有哪些文件:
zht@zht-Ubuntu:~$ ls /boot
abi-3.5.0-17-generic         lost+found
abi-3.5.0-21-generic         memtest86+.bin
abi-3.5.0-26-generic         memtest86+_multiboot.bin
config-3.5.0-17-generic      System.map-3.5.0-17-generic
config-3.5.0-21-generic      System.map-3.5.0-21-generic
config-3.5.0-26-generic      System.map-3.5.0-26-generic
grub                         vmlinuz-3.5.0-17-generic
initrd.img-3.5.0-17-generic  vmlinuz-3.5.0-21-generic
initrd.img-3.5.0-21-generic  vmlinuz-3.5.0-26-generic
initrd.img-3.5.0-26-generic

可以看到都是一些内核启动文件,很明显有些是我们不需要的(建议先卸载比较老的内核),不需要的就当垃圾处删除吧。理论上,除正在用的其它的都可以卸载,但刚升级的东西可能不稳定,为保险起见,保留1-2个之前版本备用吧

注意:卸载老的内核之前,首先用uname -a查看当前启动的是哪个内核(防止把当前正在使用的内核卸载了):
zht@zht-Ubuntu:~$ uname -a
Linux zht-Ubuntu 3.5.0-26-generic #42-Ubuntu SMP Fri Mar 8 23:18:20 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux

===============================
卸载旧的内核,命令如下:
//卸载linux-image-3.5.0-17-generic

zht@zht-Ubuntu:~$ sudo apt-get purge Linux-image-3.5.0-17-generic

之后根据提示输入yes即可完成卸载。

7,从windows复制的文件中文显示乱码

情况1:在centOS或debian等Unix系统上,使用vim编辑文件时,输入中文时,中文乱码:

#vim /root/.vimrc

输入如下配置:


    syntax on  

    set fileencodings=ucs-bom,utf-8,utf-16,gbk,big5,gb18030,latin1  

    set fileencoding=utf-8  

    :wq

再次vim编辑时OK。

解释下:syntax on表示语法高亮;fileencoding表示保存文件时的默认文件编码;fileencodings表示vim读取文件时,采用的编码识别序列,从左往右匹配。

 

情况2:在windows上编写的文件,上传至Linux上,vim编辑时乱码。原因是windows默认使用gbk编码,在Linux上,使用iconv命令可以转码:

#iconv -f GBK -t UTF-8 test.txt -o test2.txt

再次vim编辑时OK。

 

情况3:在secureCRT或xshell等SSH工具上,vim编辑文件时乱码。这个情况很办好:修改客户端的编码格式即可。以secureCRT为例:找到options---session options---terminal---Appearance,把charset encoding改为utf-8就好了。

8,安装windows和linux双系统,其中一个系统不能上网的问题

9,直接用su切换到超级管理员

方法:用

sudo passwd

然后设置密码,之后就可以用su直接切换到超级管理员。

 

参考:

[1] http://blog.csdn.net/zht666/article/details/8776316

Avatar_small
Tripura 1st HS Quest 说:
2022年8月19日 21:28

The Tripura Board of Secondary Education administers the class eleventh examination (TBSE). The Important Model Question Paper 2023 for Class 11 in All Streams of Science, Math, and Arts is Designed by TBSE. Information about the concepts that students will learn throughout the academic year is provided via the Important Model Question Paper 2023. Tripura 1st HS Question Paper 2023 The Important Model Question Paper for Class 11th in 2023 was created by Highly Qualified Subject Experts. The Important Model Question Paper 2023 is Organized Step-by-Step with the Easier Twos at the Top and Difficult Twos at the Bottom. Important Model Question Paper of Math, Physics, Chemistry, and Biology for Tripura Board Class 11 in 2023.

Avatar_small
NCERT Evs Sample Pap 说:
2022年9月29日 19:28

To get good rank easily with exact answers in the exams like Term-1, Term-2 such as SA1, SA2, FA1, FA2, FA3, FA4 and Assign exams conducting at the board or school level. Candidate who have downloaded the NCERT STD-10 EVS Sample Paper 2023 can easily get the new exam scheme or question paper style for all formats of the exams. NCERT Evs Sample Paper Class 10 To make top scores easy the students must practice with regular revisions and mock tests by using the learning & study material.

Avatar_small
Sbi Online Credit Ca 说:
2023年1月26日 22:04

SBI is one of the largest financial banks in India and it provides credit cards to a lot of users so they eventually understood that users. Owning a credit card is not a minute thing and it becomes a hassle if you are not able to address the payment dues which you can only know. Sbi Online Credit Card Login When you can access your online portal for the credit card through which you know about SBI credit card payment due and when so as to someone can arrange the money required and ensure the proper flow of their finances as well.

Avatar_small
2nd Inter Exam Patte 说:
2023年2月15日 16:47

Board of Secondary Education has deferred the Class 12th board Exam should be held from May 2024. The candidates can check the Class 12th Board blueprint Papers from true site. 2nd Inter Exam Pattern 2024 The 12th Question Paper 2024 will likewise be reported on class 12th students can take note of the total 12th Exam Pattern 2024.

Avatar_small
12thmodelpapers.in 说:
2023年7月01日 21:33

Our team is made up of professional writers and citizen journalists with a wide range of journalism interests who are passionate about reporting Education Updates with transparency in the general12thmodelpapers.in public interest.Our reporting team plans to provide the Education & Recruitment Update for all age groups and to present the actual picture of recent events through inside coverage.


登录 *


loading captcha image...
(输入验证码)
or Ctrl+Enter
Host by is-Programmer.com | Power by Chito 1.3.3 beta | © 2007 LinuxGem | Design by Matthew "Agent Spork" McGee