Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Q: What is the file shortcut called "lib"
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Installing Gentoo
View previous topic :: View next topic  
Author Message
LIsLinuxIsSogood
Veteran
Veteran


Joined: 13 Feb 2016
Posts: 1014

PostPosted: Tue Jan 17, 2017 8:58 am    Post subject: Q: What is the file shortcut called "lib" Reply with quote

Hi,
I'm sure this is not the first time or the last time I'll be running into problems while being logged in as the user "root" on a functional system. But, luckily it isn't much of a situation hopefully just a lesson. After running rm * (ha hah don't ask why) it was really luckily that the mistake was done the way it was while being in the directory of root (/). Also, since I just had listed the files in root... so I basically know what I'm missing now.

Some repairs to the filesystem
1) What is the file shortcut called "lib" (in the root directory of the filesystem)? :oops: And, does it have any really important purpose or could it be obsolete and I won't replace that then.
2) Because it was not done intentionally, to rm * from the root directory where everything else in the entire file structure happens to be located under, things really could have been far worse, like if I was in another directory, or working with a recursive invocation of the command (ouch), so just checking if there is another more preferable method for removing unwanted files and preserving the directory...I did find this from the manpage of rm:

Code:

rm --preserve-root


Thanks!
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 43221
Location: 56N 3W

PostPosted: Tue Jan 17, 2017 9:37 am    Post subject: Reply with quote

LIsLinuxIsSogood,

Code:
$ ls / -l
total 196
drwxr-xr-x   2 root root   4096 Jan  2 16:47 bin
drwxr-xr-x   2 root root   4096 Dec 28  2014 boot
drwxr-xr-x  20 root root 126976 Jan 17 08:52 dev
drwxr-xr-x  96 root root   4096 Jan  7 17:09 etc
drwxr-xr-x  13 root root   4096 Nov 19 11:51 home
lrwxrwxrwx   1 root root      5 Apr  9  2016 lib -> lib64
drwxr-xr-x  15 root root  12288 Jan  2 11:02 lib64
drwx------   2 root root  16384 May 12  2013 lost+found
drwxr-xr-x  11 root root   4096 Dec 28  2014 mnt
drwxr-xr-x   8 root root   4096 Oct 27 21:11 opt
dr-xr-xr-x 250 root root      0 Jan 17 08:52 proc
drwxr-xr-x  25 root root   4096 Jan 13 14:35 root
drwxr-xr-x  13 root root    400 Jan 17 08:52 run
drwxr-xr-x   2 root root   4096 Jan  2 17:17 sbin
dr-xr-xr-x  11 root root      0 Jan 17 08:52 sys
drwxrwxrwt   7 root root    180 Jan 17 08:53 tmp
drwxr-xr-x  24 root root   4096 Jun 28  2016 usr
drwxr-xr-x  11 root root   4096 Nov  8  2015 var


The link is for compatibility. some things look in /lib64, others is /lib but all the files are in the same place.

Look at the -i or -I options to rm.
Personally, I think rm /full/path/to/target is the safest. That's just my preference.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
Roman_Gruber
Advocate
Advocate


Joined: 03 Oct 2006
Posts: 3806
Location: Austro Bavaria

PostPosted: Tue Jan 17, 2017 5:07 pm    Post subject: Reply with quote

You could also use mc to have some gui to move / delete / edit files in a shell. (That's my choice when i only want to remove a subset, and several files)
Single files i usually delete with the full path.

rm is quite a dangerous command, mc may prevent mistakes. Especially with subset of this command rm *, and the others which may work similar because of a space in between and such. Just be careful when you use * with rm
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Installing Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum