Questions tagged [posix]

82 questions
64
votes
5 answers

less is more? Is more less? I'm so confused

When I first heard their names, I got really confused when I tried to guess what these tools might do, I thought I'd misheard something. What's the difference between more and less, i.e. why should I choose one over the other? They both seem to…
user541686
  • 23,663
  • 46
  • 140
  • 214
58
votes
9 answers

Alternative to the tee command without STDOUT

I'm using | sudo tee FILENAME to be able to write or append to a file for which superuser permissions are required quite often. Although I understand why it is helpful in some situation, that tee also sends its input to STDOUT again, I never ever…
aef
  • 1,442
  • 4
  • 18
  • 20
52
votes
2 answers

What is the difference between `/etc/environment` and `/etc/profile`?

I understand that the former is loaded prior to the latter, but what is the difference in their purpose and otherwise? Are there any good reasons I should set some variables in one and not the other? What little I understand is that /etc/environment…
Armen Michaeli
  • 2,452
  • 8
  • 32
  • 42
48
votes
3 answers

How to delete a file with a weird name?

I wrote a program that uses POSIX memory-mapping function (mmap) The program takes a file (a.dat) and memory-maps it for reading/writing. Due to errors in the program, every time I run the program a file with some weird names (e.g.,…
A. K.
  • 605
  • 1
  • 5
  • 9
31
votes
5 answers

bash pipe construct to prepend something to the stdoutput of previous command

I want to use sendmail to send me stuff and want to do it in a oneliner. echo "mail content" | sendmail emailataddres.com Sends it without subject. The subject line must come before the Mail content, so I am looking for something along the lines…
AndreasT
  • 729
  • 2
  • 7
  • 16
28
votes
3 answers

Why is NTFS case sensitive?

I personally thought that NTFS was case insensitive, since you can type cmd, CMD, cMd or even CmD and still get the command prompt. However, why is it that during a CHKDSK x: /f /r, sometimes it fixes capitalization in some files? If it didn't care…
Canadian Luke
  • 24,199
  • 39
  • 117
  • 171
27
votes
3 answers

What's the difference between SIGKILL and SIGSTOP?

The manual describes SIGKILL and SIGSTOP like this: SIGKILL 9 Term Kill signal SIGTERM 15 Term Termination signal SIGSTOP 17,19,23 Term Stop the process and states: The signals SIGKILL and SIGSTOP…
qdii
  • 1,027
  • 3
  • 13
  • 22
16
votes
2 answers

What does it mean to have a POSIX-compliant operating system?

What does it mean if the operating system is said to be POSIX-compliant?
Sergey
  • 1,685
  • 7
  • 23
  • 29
14
votes
1 answer

SUID bit on directories

In Linux there are SUID, SGID, and sticky bits for directory permissions. I am absolutely clear about the sticky and SGID bit on files or folders. But what happens if I apply SUID bit on a directory? For example, if I apply a SGID bit on a file, a…
TheMAn
  • 153
  • 1
  • 1
  • 7
13
votes
5 answers
12
votes
6 answers

Standard way to duplicate a file's permissions

I am trying to find a standard POSIX way to duplicate one file's permissions to another file. On a GNU system this is easy: [alexmchale@bullfrog ~]$ ls -l hardcopy.* -rw-r--r-- 1 alexmchale users 2972 Jul 8 20:40 hardcopy.1 ---------- 1 alexmchale…
Alex
  • 715
  • 2
  • 6
  • 8
9
votes
3 answers

does PATH search include symlinks?

The POSIX shell standard says on this site http://pubs.opengroup.org/onlinepubs/9699919799/ about how shells use PATH to look for executables: "The list shall be searched from beginning to end, applying the filename to each prefix, until an…
user322908
  • 769
  • 2
  • 13
  • 24
8
votes
2 answers

Script to convert ext4 filenames to NTFS

ext4 allows certain chars in filenames which NTFS doesn't. Is there a script to replace those chars in filenames?
8
votes
1 answer

How to convert a Windows path (with backslashes) to Unix format on Babun/Cygwin

I'm using Windows and writing shell scripts to run on Babun (a POSIX api). I need to read a path from an environment variable, $USERPROFILE, and convert it to unix style (replace \ by /, c:\ by /c/) so I can use it later in the script. The problem…
Victor Basso
  • 583
  • 1
  • 7
  • 10
7
votes
2 answers

discover the directory that prevents a file from being read in linux

i'm getting a permission denied for a user in a really long path. $ sudo sudo -u user cat /l/o/n/g/path/file Permission denied i'm pretty sure path and file have permissions for that user. Is there any easy way to find which of the other…
gcb
  • 4,764
  • 11
  • 53
  • 73
1
2 3 4 5 6