ubuntu tips

File recoding recent activities: ~/.local/share/recently-used.xbel

直接刪了就可以清除Dash Home里的最近記錄

設(shè)置圖形界面的開機(jī)啟動(dòng)項(xiàng):  在startup application里直接設(shè)置,或者想折騰的,寫個(gè) XXX.desktop保存到 ~/.config/autostart/ 這個(gè)目錄下,具體格式差不多這樣:

[Desktop Entry]
Type=Application
Exec=/home/alex/.keynav #執(zhí)行的腳本位置
Hidden=false
NoDisplay=false
X-GNOME-Autostart-enabled=true
Name[en_US]=keynav
Name=keynav
Comment[en_US]=run keynav deamon
Comment=

Ubuntu設(shè)置開機(jī)啟動(dòng)為文本界面:

/**

  • All procedures I configured the computer to boot up in shell command
    **/

/etc/default/grub
Comment the line GRUB_CMDLINE_LINUX_DEFAULT=”quiet splash”, by adding # at the beginning, which will disable the Ubuntu purple screen.
Change GRUB_CMDLINE_LINUX=”" to GRUB_CMDLINE_LINUX=”text”, this makes Ubuntu boot directly into Text Mode.
Uncomment this line #GRUB_TERMINAL=console, by removing the # at the beginning, this makes Grub Menu into real black & white Text Mode (without background image)
sudo update-grub

awk 'BEGIN { statements}  pattern { command } END { statements} '

中間的pattern 相當(dāng)于條件判斷,command為命令。

例: 截取文件里第一行以為的第2、3欄的內(nèi)容,并輸出他們的和

cat FileName | awk 'RN>1 { sum=2+3; print 2,3, sum } '

SIGHUP (1) - Hangup detected on controlling terminal or death of controlling process. Use SIGHUP to reload configuration files and open/close log files.
SIGKILL (9) - Kill signal. Use SIGKILL as a last resort to kill process. This will not save data or cleaning kill the process.
SIGTERM (15) - Termination signal. This is the default and safest way to kill process.

;way to rename files that containing specila characters
find . -type f -inum `ls -i|grep $FILE_NAME|awk {print $1}` -exec mv {} $NEW_NAME

in vim,type :%!xxd to enter hex mode and use %!xxd -r to exit from hex mode

when the cd drive cant ejcet, run:
sudo ejcet -i off

//print all fields with seperator

cat template.cpp |awk 'BEGIN{FS="}"; OFS="\n"} {$1=$1;print "number "NR, $0}' > aaa
${MYVAR#pattern}       # delete shortest match of pattern from the beginning
${MYVAR##pattern}      # delete longest match of pattern from the beginning
${MYVAR%pattern}       # delete shortest match of pattern from the end
${MYVAR%%pattern}      # delete longest match of pattern from the end

https://stackoverflow.com/questions/19482123/extract-part-of-a-string-using-bash-cut-split

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡書系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容