Download your favorite Linux distribution at LQ ISO.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 08-16-2010, 03:16 PM   #1
Registered: Nov 2007
Distribution: CentOS 6
Posts: 195

Rep: Reputation: 22
nice can't cd?

I updated my CentOS system and suddenly nice can't cd.

nice -n -18 cd orangebox/ && ./srcds_run -game cstrike -ip -port 27015 -maxplayers 15 -tickrate 66 +fps_max 550 +map de_dust2 +servercfgfile server.cfg +tv_enable 1 +tv_maxclients 15 +tv_port 27020

nice: cd: Permission denied
if I run it as su I get:
nice: cd: No such file or directory

This syntax used to work.
Old 08-16-2010, 03:45 PM   #2
Senior Member
Registered: May 2006
Location: USA
Distribution: Debian
Posts: 4,824

Rep: Reputation: 615Reputation: 615Reputation: 615Reputation: 615Reputation: 615Reputation: 615
This syntax used to work.
Ummmm, are you sure? "cd" is a shell builtin. You can't nice shell builtins (or do some other things with them). So you must have been doing it differently, or doing something else.

nice the srcds_run command instead.
Old 08-17-2010, 08:28 AM   #3
Registered: Nov 2007
Distribution: CentOS 6
Posts: 195

Original Poster
Rep: Reputation: 22
Yes, you're right. The startup command changed. I didn't used to have to cd to orangebox in order to srcds_run, but steam has changed the directory structure on Couter-Strike: Source.
Old 08-17-2010, 08:49 AM   #4
Registered: Feb 2009
Distribution: Debian, CentOS 5, Gentoo, FreeBSD, Fedora, Mint, Slackware64
Posts: 208

Rep: Reputation: 46
I don't know if this will work, but you could try encasing the commands in a shell, like:
nice -n -18 sh -c "cd /tmp;touch this_file.txt"
Old 08-17-2010, 09:43 AM   #5
Gentoo support team
Registered: May 2008
Location: Lucena, Córdoba (Spain)
Distribution: Gentoo
Posts: 4,077

Rep: Reputation: 400Reputation: 400Reputation: 400Reputation: 400Reputation: 400
I don't get the point of nice'ing "cd" at all (because that's what you are doing). '&&' is a shell control operator and it is catch by your shell, it is not interpreted by nice (in fact, it doesn't even reach nice at all, in case that was your intention). Maybe you meant this instead:

cd foo && nice -n -18 ./srcds_run <whatever_else>
Or even:

nice sh -c 'cd /foo && ./srcds_run <whatever_else>
But, as said, niceing cd is completely irrelevant, it's an instantaneous command that just runs and gets you into a directory, it's not like it'll be running for two hours or wasting cpu time at all.....


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Nice to see you again! harken General 2 02-03-2010 08:51 AM
nice -20 and nice +20 graziano1968 Linux - General 2 04-23-2008 01:04 PM
Hello all - nice to be here. the_future Member Intro 1 04-18-2006 04:26 PM
Google has been nice to my site. Is it nice to your site? Travis86 General 5 08-31-2003 02:38 PM
Nice and confused about nice Hangdog42 Linux - General 5 06-03-2003 05:44 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 06:59 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration