How To View Only Hard Links

Hi All,

Is there any command or shell scripting to view only the link files under / .


Similar Content



Password Changing In Shell Scripting

Hi,

i am using ubuntu 12.04 i working on scripting i want know how to change set of user passwords in shell scripting .

Do You Have To Have Execute On A Directory To Be Able To View Contents In It?

hi guys im a little confused

read privilege on a directory means i can list the contents
write means i can save,edit and delete files in that directory
but then it says execute is like a light switch,if its off (no execute) you will not be able to view items in the directory

so do you have to have rwx on a directory to be able to use it fully?
if you have rw- as the owner will you not be able to view or change
into subdirectories within that directory?

How To View (primary) Group Members ?

Dear Linux Gurus, how to view all group members?

my code snippet is like below:

groupadd yy
useradd -g yy u1
useradd -g yy u2
useradd -g yy u3

useradd -G yy u4


when i wanted to view the group members of group 'yy' in /etc/group, it only shows secondary group member i.e only u4. what is the problem? Why not showing other group members-u1,u2,u3?

I also used commands getent and groupmems, but they are showing only secondary group members i.e only u4 not others.

But when I used 'system-config-users', in group page, it shows all the users.

My doubt is how to view all the users belonging to group yy in terminal. which command to use?

Thanks in advance.
sorry for the grammatical mistakes.

How Do I Know If A File Has A Hard Link To It?

ok I know when I create a soft link, it shows a ----> in a long listing and is colored (if ls --color) in aqua.

But hard links don't do this. How can I tell if a file/dir has a hard link to it or if it points to another file?

Kinds Of Links In Linux And Use Of Unlink

Hello, I am learning about file types in Linux, and i see there are hard and symbolic links, also I saw that unlink function in C deletes a link to a file and decrements the intern link counter. The problem is that i don't understand what link is deleted when unlink is called. Is it the parents link to that file?

Checking Presence Of A File Identified/ Addressed By A Variable

hi,

I am newbie in Linux shell scripting.Can anybody help me to check the presence of file identified by variable in Shell scripting?

For example: I am reading the content of a file using while command as below:
"while read -r line
do
code block
done < file_name"

Now in this case every line in file gets stored in the variable 'line' one by one.Problem here is every line in the file is nothing but the file_path of another file say xyz.txt and I am checking presence of this xyz.txt file using below command:
if [-f $line]
as 'line' is the variable which stores file path of xyz.txt but it is not working. It is unable to check the presence of this xyz.txt file as i am addressing it with the variable 'line'.

Please help me.Thanks in advance.

Bash: Javac: Command Not Found???

I'm new to linux but I use linux a little at school and by connecting through a shell at home. Anyways, I just installed linux a little while ago and I opened a shell and tried to compile some java code by going to the directory of the code and typing "javac someCode.java" like I do at school but it says the command is not found.

I previously had installed the java runtime environment and I just went to go and try to install the java development kit but it says it was already installed.

Is there some sort of path I need to set for the shell to look for the java compiler? Thanks in advance.

Edit:
I have added aliases to my .cshrc file at school and I just found a bashrc file and csh.cshrc file in the /etc folder. Sorry, I'm really new to all of this. Anyways, I'm geussing I have to edit the bash file? Can anyone point me to a good tutorial of scripting for these files???

Best Scripting Language For Beginner : Bash Vs Python Vs Perl

I have reasonable experience in linux based systems. I want to learn a scripting language , can anyone out there suggest which one is the best to start with ? I would be grateful if anyone can provide me with links / books references as well ...

Sh: -c: Line 1: Syntax Error Near Unexpected Token `('

Hi,
I am working with a software that is based on Perl scripting and I have encountered with a bash scripting error. So as I am not familiar with bash scripting well, I don't know how I can solve.
sh: -c: line 1: syntax error near unexpected token `('
sh: -c: line 1: ` 32(andRlooks_unw'

It should be mentioned that my $SHELL is /bin/bash. Could you please guide me what '-c' is? where is it? if I change the shebang (the #!/bin/sh part) to #!/bin/bash, the problem will be solved?

Regards,
Zahra

Recursively Move Files Of One Type And Create Destination Sub-folders

I'm just getting into Bash scripting, and would appreciate some help with this question. My music collection is split into a smaller, "active" set, kept on my laptop, and a much larger collection on an external hard drive. I've just converted some of the larger filetypes on my "active" set to *.mp3, and now want to move all the original files (*.flac) to the external hard drive. I need some help putting together a command or script that will recursively search my active music set for *.flac and then move them, but keeping the source directory structure. Some or all of these subdirectories may not exist on the destination.

eg. On the active music set, I may have:

/Music/artist1/album1/(a mix of *.mp3 and *.flac files)
/Music/artist2/album1/(a mix of *.mp3 and *.flac files)

and on the hard drive

/Music 2/artist1/album2/(the contents of the album)

So when copying, it'll need to create "/album1/" in "artist1" on the destination, and also "/artist2/album1/"

Thanks in advance!