Sponsored Content
Top Forums Shell Programming and Scripting Linux correct permissions for .bash_aliases Post 302999320 by Aia on Friday 16th of June 2017 07:13:26 PM
Old 06-16-2017
Quote:
Originally Posted by iamwrong
Above is a search string I tried on Google that produced lots of hits but not much in the way of clues. And I wasn't looking for clues.

So I decided, for the first time, to ask the question here. What are the correct permissions for the .bash_aliases file?

iwrong
644 or 640
 

9 More Discussions You Might Find Interesting

1. HP-UX

To give the "unzip" permissions & "create" file permissions

Hi, I am a Unix Admin. I have to give the permissions to a user for creating new file in a directory in HP-Ux 11.11 system since he cannot able to create a new file in the directory. Thanks in advance. Mike (3 Replies)
Discussion started by: Mike1234
3 Replies

2. Shell Programming and Scripting

Please correct this

I have input file like this Input file: ABC|abc_etc_passwd XYZ|XYZ_etc_passwd zXY|XYZ_etc_passwd IJK|test_etc_passwd KLM|test_etc_passwd i want to do following in a loop. grep 'ABC' *abc_etc_passwd* grep 'XYZ' *XYZ_etc_passwd* grep 'ZXY' *ZXY_etc_passwd* i have tried this for i... (2 Replies)
Discussion started by: pinnacle
2 Replies

3. Solaris

in correct drive name

I am new to solaris and I replaced a faulty tape drive sun DLT7000 But, I am getting the follwoing error when system reboots ltid deamon error drive index 1 is not correct, drive name /dev/rmt/2cbn is incorrect no such file or directory. I have two drives the other one is /dev/rmt/0cbn,... (8 Replies)
Discussion started by: latif1958
8 Replies

4. UNIX for Advanced & Expert Users

Keeping your Home file permissions correct

I have been a UNIX user for a long time, and in that time I have been looking for a program to set/reset all the file permissions of a complex directory hierarchy (my home) according to a configuration file of rules. That is not the simple find-xargs-chmod rule but a program (shell/perl/c)... (4 Replies)
Discussion started by: antofthy
4 Replies

5. Shell Programming and Scripting

ksh; Change file permissions, update file, change permissions back?

Hi, I am creating a ksh script to search for a string of text inside files within a directory tree. Some of these file are going to be read/execute only. I know to use chmod to change the permissions of the file, but I want to preserve the original permissions after writing to the file. How can I... (3 Replies)
Discussion started by: right_coaster
3 Replies

6. Shell Programming and Scripting

Check the permissions linux user

i have some question for example: suppose we have the Public folder as follows: https://www.unix.com/attachment.php?attachmentid=2759&stc=1&d=1334070669 If the user enter: -Kenshin or /home/kenshin/Public output: abc: kenshin: rw my shell: echo "Enter User:" read user ... (3 Replies)
Discussion started by: kingkner
3 Replies

7. Red Hat

Control M user permissions on Red Hat Linux

All, Requirement: Permissions Required for Control M on Linux I am using the Linux as the operating system. I am told to get an user configured for Control M on Linux. The user would be an authenticated user created by the client. The user created requires permissions to be made available so... (2 Replies)
Discussion started by: Roadies99
2 Replies

8. Shell Programming and Scripting

How to get the correct IP on a Linux server?

Hi I need to get IP address from linux server. There are many script to do this, but no one is perfect. They just grab eth0 or eth1 from ifconfig, and this may, may not be correct. You may have several IF configured, but only one is default GW Here is how I would like the process to be.... (8 Replies)
Discussion started by: Jotne
8 Replies

9. Solaris

Problem exporting NFS filesysytem with root permissions to Linux

Hi, I have a Solaris 10 server and I want to export a filesystem to a linux client and give the client's root user root priviliges on the filesystem. The client is an ubuntu 14.04 LTS server. the dfstab on the server looks lik this: /usr/sbin/share -F nfs -o ... (1 Reply)
Discussion started by: nvanvliet
1 Replies
lsMode(3pm)						User Contributed Perl Documentation					       lsMode(3pm)

NAME
Stat::lsMode - format file modes like the "ls -l" command does SYNOPSIS
use Stat::lsMode; $mode = (stat $file)[2]; $permissions = format_mode($mode); # $permissions is now something like `drwxr-xr-x' $permissions = file_mode($file); # Same as above $permissions = format_perms(0644); # Produces just 'rw-r--r--' $permissions = format_perms(644); # This generates a warning message: # mode 644 is very surprising. Perhaps you meant 0644... Stat::lsMode->novice(0); # Disable warning messages DESCRIPTION
"Stat::lsMode" generates mode and permission strings that look like the ones generated by the Unix "ls -l" command. For example, a regular file that is readable by everyone and writable only by its owner has the mode string "-rw-r--r--". "Stat::lsMode" will either examine the file and produce the right mode string for you, or you can pass it the mode that you get back from Perl's "stat" call. "format_mode" Given a mode number (such as the third element of the list returned by "stat"), return the appopriate ten-character mode string as it would have been generated by "ls -l". For example, consider a directory that is readable and searchable by everyone, and also writable by its owner. Such a directory will have mode 040755. When passed this value, "format_mode" will return the string "drwxr-xr-x". If "format_mode" is passed a permission number like 0755, it will return a nine-character string insted, with no leading character to say what the file type is. For example, "format_mode(0755)" will return just "rwxr-xr-x", without the leading "d". "file_mode" Given a filename, do "lstat" on the file to determine the mode, and return the mode, formatted as above. Novice Operation Mode A common mistake when dealing with permission modes is to use 644 where you meant to use 0644. Every permission has a numeric representation, but the representation only makes sense when you write the number in octal. The decimal number 644 corresponds to a permission setting, but not the one you think. If you write it in octal you get 01204, which corresponds to the unlikely permissions "-w----r-T", not to "rw-r--r--". The appearance of the bizarre permission "-w----r-T" in a program is almost a sure sign that someone used 644 when they meant to use 0644. By default, this module will detect the use of such unlikely permissions and issue a warning if you try to format them. To disable these warnings, use Stat::lsMode->novice(0); # disable novice mode Stat::lsMode->novice(1); # enable novice mode again The surprising permissions that are diagnosed by this mode are: 111 => --xr-xrwx 400 => rw--w---- 440 => rw-rwx--- 444 => rw-rwxr-- 551 => ---r--rwt 600 => --x-wx--T 640 => -w------T 644 => -w----r-T 660 => -w--w-r-T 664 => -w--wx--T 666 => -w--wx-wT 700 => -w-rwxr-T 711 => -wx---rwt 750 => -wxr-xrwT 751 => -wxr-xrwt 751 => -wxr-xrwt 755 => -wxrw--wt 770 => r------wT 771 => r------wt 775 => r-----rwt 777 => r----x--t Of these, only 400 is remotely plausible. BUGS
As far as I know, the precise definition of the mode bits is portable between varieties of Unix. The module should, however, examine "stat.h" or use some other method to find out if there are any local variations, because Unix being Unix, someone somewhere probably does it differently. Maybe it "file_mode" should have an option that says that if the file is a symlink, to format the mode of the pointed to file instead of the mode of the link itself, the way "ls -Ll" does. SEE ALSO
o "http://www.plover.com/~mjd/perl/lsMode/". o ls o chmod o stat AUTHOR
Mark-Jason Dominus ("mjd-perl-lsmode@plover.com"). perl v5.10.1 1998-04-20 lsMode(3pm)
All times are GMT -4. The time now is 01:38 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy