Linux Ask!

Linux Ask! is a Q & A web site specific for Linux related questions. Questions are collected, answered and audited by experienced Linux users.

Feb 082010
 

sed: replace in place

Answer:

Newer version of sed allow you replace a file in place, no more redirection is needed.

# sed -i 's/abc/def/g' test.txt

The above command will replace all "abc" to "def" in the file test.txt

Feb 082010
 

How to get the file creation time?

Answer:

Linux never stores file creation time.

You can only get access, modify & change (change of status, e.g. permission) time of a file with stats command

# stats test.txt

stat test.txt
  File: `test.txt'
  Size: 25557           Blocks: 56         IO Block: 4096   regular file
Device: ca01h/51713d    Inode: 32714       Links: 1
Access: (0644/-rw-r--r--)  Uid: ( 1001/    user)   Gid: ( 1000/ user)
Access: 2010-01-02 18:53:46.000000000 +0800
Modify: 1970-01-01 17:13:08.000000000 +0800
Change: 2010-01-02 18:53:46.000000000 +0800
Feb 072010
 

Turn off PC speaker in Ubuntu Linux

Answer:

To turn of PC speaker so no more beep sound in Ubuntu

1. edit /etc/modprobe.d/blacklist

# sudo vi /etc/modprobe.d/blacklist

2. append the following line, save the file.

blacklist pcspkr

Restart your system to take effect.