What does -f mean in bash

0 votes

I was looking at how to use runit to run gunicorn. I was looking at the bash file and I don't know what -f $PID does in

#!/bin/sh

GUNICORN=/usr/local/bin/gunicorn
ROOT=/path/to/project
PID=/var/run/gunicorn.pid

APP=main:application

if [ -f $PID ]; then rm $PID; fi

cd $ROOT
exec $GUNICORN -c $ROOT/gunicorn.conf.py --pid=$PID $APP

Google is useless in this case because searching for flags is useless

Jun 9 in Linux Administration by Rahul
• 3,380 points
6 views

1 answer to this question.

0 votes
Luckily, the Bash Reference Manual is accessible on the web, at http://www.gnu.org/programming/slam/manual/bashref.html. It's the principal hit when you Google for "Slam manual". §6.4 "Slam Conditional Expressions" says:

-f document

Valid on the off chance that document exists and is an ordinary record.
answered Jun 10 by Korak
• 5,820 points

Related Questions In Linux Administration

0 votes
1 answer

What does '-gt' operator mean in Bash programming?

It's a math test. assist with testing ...READ MORE

answered Jun 20 in Linux Administration by Rahul
• 3,380 points
9 views
0 votes
0 answers

What does the $ mean in Linux?

I have to explain what the code ...READ MORE

Apr 13 in Linux Administration by Soham
• 8,730 points
42 views
+1 vote
2 answers

What does file permission 755 mean?

Hi, File permission 755 means that the directory ...READ MORE

answered Dec 9, 2020 in Linux Administration by MD
• 95,360 points
164,106 views
0 votes
0 answers

What exactly does the Unix `bash` command do when run without options?

When you type bash into the terminal ...READ MORE

Apr 14 in Linux Administration by Soham
• 8,730 points
21 views
0 votes
0 answers

What does "&" at the end of a linux command mean?

I am a system administrator and I ...READ MORE

Apr 21 in Linux Administration by Edureka
• 13,640 points
20 views
0 votes
1 answer

What does “sudo echo nameserver 8.8.8.8 > /etc/resolv.conf” do?

If executing this command resolved your issue ...READ MORE

answered Jan 23, 2019 in Linux Administration by joey
2,015 views
0 votes
1 answer

How to take input from user in bash script?

You can use if-else branch to check ...READ MORE

answered Jan 31, 2019 in Linux Administration by Omkar
• 69,210 points
439 views
0 votes
1 answer

What is absolute path in Ubuntu?

An absolute path is a path to ...READ MORE

answered Feb 9, 2019 in Linux Administration by Omkar
• 69,210 points
550 views
0 votes
1 answer

How to check if a string contains a substring in Bash?

You ought to recollect that shell prearranging ...READ MORE

answered May 27 in Linux Administration by Korak
• 5,820 points
17 views
0 votes
1 answer

Is there a limit on the number of words in bash command 'for file in words'?

Anyway, you need to print everything except ...READ MORE

answered May 27 in Linux Administration by Korak
• 5,820 points
16 views
webinar REGISTER FOR FREE WEBINAR X
Send OTP
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP