how to open all shortcuts files from a directory with chromium-browser in one command [closed] - linux

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 6 years ago.
Improve this question
On ubuntu 16.04, i have a directory with these files :
-rw-rw-r-- 1 user0 user0 86 jui 7 21:32 vim html picker.url
-rw-rw-r-- 1 user0 user0 104 jui 7 21:32 cocoonjs build android apk.url
-rw-rw-r-- 1 user0 user0 61 jui 7 21:32 Simple Modal Window - Codepad.url
-rw-rw-r-- 1 user0 user0 96 jui 7 21:32 cocoon.js android build apk+++.url
-rw-rw-r-- 1 user0 user0 44 jui 7 21:32 CodePen - Front End Developer Playground & Code Editor in the Browser (1).url
The file "vim html picker.url" have this information :
--> cat vim\ html\ picker.url
[InternetShortcut]
URL=https://github.com/KabbAmine/vCoolor.vim/blob/master/README.md
what i want to do is open all of theses files from this directory in tab in my chromium-browser.
i have tried this in my gnome-terminal :
chromium-browser *.*
but chrome open the text information : URL=https://github.com/KabbAmine/vCoolor.vim/blob/master/README.md and not the url itself :https://github.com/KabbAmine/vCoolor.vim/blob/master/README.md.
wich command allow my desired behaviour ?

grep "^URL=" *.url | cut -d= -f2 | xargs chromium-browser
should do the trick.
Explanation:
grep "^URL=" *.url - cut the line beginning with URL= from each file ending in .url
cut -d= -f2 - split each remaining line into parts delimited by '=' and output the second and all subsequent parts (i.e. the part after the first '=')
xargs chromium-browser - use the list of URLs as arguments to chromium.

Related

Why does one command need sudo but the other one doesn't with the same permissions [closed]

Closed. This question is not about programming or software development. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 3 days ago.
Improve this question
I have the bzcat command with the following permissions:
-rwxr-xr-x 3 root root 39144 Sep 5 2019 /bin/bzcat
I have the bzmore command with the following permissions:
-rwxr-xr-x 1 root root 1297 Sep 5 2019 /bin/bzmore
And I have a bz2 zip file:
-r-------- 1 root root 61 Feb 17 14:37 flag.bz2
When I use bzmore flag.bz2 it works fine. But when I use bzcat flag.bz2 I get Can't open input file flag.bz2: Permission denied.. Why is this? If I put sudo in front of bzcat it works fine too but why doesn't bzmore need this when they both have the same permissions.
I tried running all the commands to test out what happened.

Linux group 998,what does it mean? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 2 years ago.
Improve this question
Ubuntu 20 LTS, Installed laradock,
in Ubuntu
$ pwd
/root/Docker
$ ls
blog laradock
$ rsync -a /media/sf_code/blog . && chmod -R 755 blog
$ cd laracock
$ docker-compose exec --user=root workspace bash
in docker
> ll
total 20
drwxr-xr-x 4 laradock laradock 4096 Nov 12 06:52 ./
drwxr-xr-x 1 root root 4096 Nov 12 02:30 ../
drwxr-xr-x 12 root 998 4096 Nov 12 03:09 blog/
drwxr-xr-x 74 laradock laradock 4096 Nov 12 06:35 laradock/
what does 998 mean?
The 4th column is the group id. It there is an entry in /etc/group with this id, then the group name will be printed otherwise the id.
The your example the group id of folder blog is 998 but no group exist inside the container with this id. Mapping a folder to a docker container does not change owner or group.
Some explanation can be found here

Mac OSX file permissions has '#' - how to remove that '#' [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 6 years ago.
Improve this question
How can I remove that '#' character from the file permissions?
'#' in file permissions for Mac/OSX machines, is used to show that an extended attribute is set with this file.
Tried chmod 755 galaxy-ansible.yml but that didn't help.
Tried echo | chmod -E galaxy-ansible.yml, didn't help (even with using sudo).
Tried xattr -d galaxy-ansible.yml, that didn't help either (even with using sudo).
I even did the above operations as root user, still '#' character is not going away from file's permissions.
[arun#MacBook-Pro-2 ~/aks/anisble] $ ls -l# galaxy-ansible.yml
-rwxr-xr-x# 1 arun staff 270 Dec 22 12:31 galaxy-ansible.yml
com.apple.quarantine 67
My ~/aks folder is mapped to a CentOS vagrant box and if I'm on the vagrant box, doing ls -l doesn't give me '#' (as it's not a Max/OSX machine):
-rwxr-xr-x. 1 vagrant vagrant 270 Dec 22 00:12 galaxy-ansible.yml
On my Mac/OSX machine, there are other .yml files but those don't have '#' in the file permissions so I'm trying to remove '#' from galaxy-ansible.yml file (on Mac machine).
Right now the whole roles/.. folder has '#' character for any folder/files.
-rwxr-xr-x# 1 arun staff 1132 Dec 21 17:12 README.md
drwxr-xr-x# 3 arun staff 102 Dec 21 17:12 defaults
drwxr-xr-x# 3 arun staff 102 Dec 21 17:12 handlers
drwxr-xr-x# 4 arun staff 136 Dec 21 17:12 meta
drwxr-xr-x# 5 arun staff 170 Dec 21 17:12 tasks
drwxr-xr-x# 7 arun staff 238 Dec 21 17:12 templates
The following commands helped in clearing the extended attribute at file / folder(recursive) level.
xattr -c <yourfilename>
or
xattr -cr <yourfoldername>

Soft Link redirection in linux [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 6 years ago.
Improve this question
I have created a soft link as follows:
/bip/etl>ln -s /bip/etl bipet
And now can see the soft link being created as well..
/bip/etl>ls -lrt |tail
-rw-rw-rw- 1 cdtbipx cduserg 24988174 Jun 19 19:17 227015716_WLR3PSTN_Filtered_06202016_5of6.csv.gz.gpg
-rw-rw-rw- 1 cdtbipx cduserg 23857587 Jun 19 19:17 227015716_WLR3PSTN_Filtered_06202016_6of6.csv.gz.gpg
drwxrwxrwx 1082 prod release 61440 Jul 3 02:51 WSC
drwxrwxrwx 5 oracle oinstall 4096 Jul 4 01:22 dsl
lrwxrwxrwx 1 cdtbipx cduserg 8 Jul 4 08:43 bipet -> /bip/etl
However, I cannot refer to the soft link bipet while I try to search a specific file in the concerned folder.
ls -lrt /bipetl/227015716_WLR3PSTN_Filtered_06202016_6of6.csv.gz.gpg
ls: /bipetl/227015716_WLR3PSTN_Filtered_06202016_6of6.csv.gz.gpg: No such file or directory
What am I doing wrong here?
You created a link bipet in directory /bip/etl (current working directory when you did ln).
You you should do:
ls -lrt /bip/etl/bipetl/227015716_WLR3PSTN_Filtered_06202016_6of6.csv.gz.gpg
Or create the link using (assuming you have privileges to write to the /):
ln -s /bip/etl /bipet
And then you can do:
ls -lrt /bipetl/227015716_WLR3PSTN_Filtered_06202016_6of6.csv.gz.gpg

Removing old users’ home directories from Linux server [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 11 years ago.
Improve this question
We have an NFS server with thousands of users home directories. I did a lot of searching and man page reading and I can't seem to figure this out.
I want to remove the home directories of the users that are no longer with us. Basically anyone that hasn't logged in and made changes to their home folders in over a year.
The snag i keep hitting is every tool i see (ls, find, etc) will give me the listing on the last time a directory was modified but not the contents inside.
Take the user Joe for example.
/data/Users/joe/Windows# ls -lt
drwxrwx---+ 2 1079 nhsstaff 4096 2008-07-31 15:13 Cookies
So judging from this output you would think this folder had not been access since July 7th 2008.
But when you look inside the directory:
`root#smb0:/data/Users/joe/Windows/Cookies# ls -ltr
-rwx------+ 1 1079 nhsstaff 92 2009-02-17 03:16 default#sun[1].txt
-rwx------+ 1 1079 nhsstaff 86 2009-02-17 03:16 default#ig[1].txt
-rwx------+ 1 1079 nhsstaff 136 2009-02-17 03:16 default#google[1].txt
-rwx------+ 1 1079 nhsstaff 104 2009-02-17 03:16 default#dell[1].txt
-rwxrwx---+ 1 1079 nhsstaff 32768 2010-04-26 07:53 index.dat`
You can see files have been changed since April 26th 2010.
So to sum up, i need a way to search and sort when the last time a home directory was used.
run this command:
find /data/Users -mtime +365 | awk '{print $1}' | cut -f2 -d"/" | sort\
| uniq -c | awk '{print $2}'
This set of commands will give you list of all those users, who have not modified their home folders for more than a year.
If you want script to auto delete those folders through script, I can provide it as well.

Resources