Skip to main content
Develop Tools
← Return to usage guide

Linux Command List and Search Cheat Sheet | Comprehensive Guide to Usage, Configuration, and Troubleshooting

Permission denied can occur not only because of a File's numeric Mode, but also because of the execution User, parent Directory, Owner and Group, ACL, Security Module, or Mount Option. Identify the cause before using chmod 777 or sudo.

Diagram dividing Permission denied into User, Owner, Mode, parent Directory, and additional controls
Diagram dividing Permission denied into User, Owner, Mode, parent Directory, and additional controls

Search Linux commands by purpose or symptom

Even if you do not remember the command name, you can narrow candidates from a Japanese purpose or Error Message and check Syntax, Options, and risk.

Open Linux command list/search cheat sheet

Conclusion: Identify the required action and the layer that denied it, then correct only the minimum permissions

Decide whether read, write, or execute/search is needed, then check the execution User and Mode of each Path Component. If the Owner differs, chown or Group design is required rather than chmod.

whoami
id
ls -ld /path /path/to /path/to/file
stat /path/to/file

chmod 777 gives everyone read, write, and execute permissions. Do not use it as a universal fix without identifying the cause.

Check the status first

Check search permission for every directory in the path, not only the target file.

Account to checkCommand examplesjudgment
Execution userwhoami / idOwner and Group membership
Target models -l / statInsufficient r/w/x
Parent Directoryls -ld for each directory levelMissing x
Additional controlsgetfacl / SELinux / mountDenied outside the mode

Linux commands to use and commonly used options

Commands and syntaxroleCheck points
ls -l / ls -ldCheck mode, owner, and groupThe first character is the file type
chmodChange the modeSymbolic or Octal
chown / chgrpChange Owner and GroupAdministrative permissions and scope of impact
idCheck User / GroupAlso check the Process execution User.

Steps to isolate the issue safely

  1. Break down rejected operations into read, write, and execute.
  2. Check the execution user and group.
  3. Check the mode of the target and parent directory.
  4. Check ACL, SELinux, noexec, and similar settings.
  5. Change permissions to the minimum necessary principals and check again.

How to read the output and common causes

Mode display has three sets: owner, group, and other. Directory x is the search permission that allows reaching contents beneath it.

Display and symptomsMeaning and possible causesNext check
-rw-r-----Owner rw, Group rRelationship to the execution user
drw-r--r--No execute permission on the directoryTraversal unavailable
Operation not permittedOwner, Capability, and similar valuesConfirm the execution principal
Denied even when the mode is correctACL, SELinux, and mountsAdditional access control

Remedies and dangerous operations

Record the previous mode and owner/group, then make limited changes while preserving a reversible state.

purposeSuggested actionsCaution
Add execution permission for the ownerchmod u+x FILEAlso check Script content.
Add read permission to the groupchmod g+r FILEVerify group membership
Fix Ownerchown USER FILECheck the Service execution User.

Because granting sudo, recursive chmod/chown, and changing permissions to 777 have a broad impact, prepare a target list and Rollback plan.

Check command implementation, distribution, and shell differences

Commands on Linux are not all provided by one project. Their implementations differ among GNU Coreutils, GNU Grep, GNU Findutils, procps-ng, iproute2, systemd, OpenSSH, curl, and others, and options and output vary with BusyBox and BSD implementations.

Account to checkHow to checkjudgment
What the command refers totype -a NAME / command -V NAMEDistinguish built-ins, aliases, functions, and externals
Implementation and versionNAME --version / package informationCheck whether the article's options are available
Shell in useprintf "%s\n" "$SHELL" / Process informationCheck syntax differences such as Pipeline and Redirect.
Distribution/etc/os-releaseCheck the Package Manager and Service Manager.

Examples in the article are based on a typical GNU/Linux environment. Before running them, prioritize that device's man pages, --help output, and official documentation.

What can be checked with DevelopTools' Linux command search

FunctionWhat you can check
searchCommand name, purpose, Japanese and English keywords, and error keywords such as Permission denied
FilterCategory, risk level, required permissions, command type, and environment
CategoryExternal Command, Shell Builtin, Shell Operator, Redirection Operator
DetailsSyntax, main Options, Example, implementation source, related Commands, common Errors
SafetyDisplay normal operations, review-required operations, administrative operations, and destructive operations with text labels
UnsupportedTerminal connection, Command execution, Server status diagnostics, Installed Version auto-detection

Perform final verification with official documentation

Prioritize the manual that matches the implementation and version in use. If examples on the web do not match the options on your system, use the system's man pages and package information as the basis for judgment.

The Script returns Permission denied.

Check not only for missing x but also noexec Mount, Shebang, and Interpreter.

Record output and exit status before and after execution, and confirm that the operation affected only the intended targets.

  1. ls -l script.sh
  2. Check the executing User and parent Directory
  3. If needed, chmod u+x script.sh
  4. Check Shebang, line breaks, and noexec.

You can also use a chmod permission calculator for permission calculations, but check the actual file state on the device.

Frequently asked questions

Can I run commands from an article directly in production?
Do not run it as-is. Check the Placeholder, target Path, PID, Host, executing User, and expanded Wildcards, then try it incrementally starting with read-only commands.
Can I use the same Options on Linux?
It varies by implementation, Distribution, Version, BusyBox environment, and more. Check type, --version, man, --help, and official Documentation.
Does DevelopTools execute Linux commands?
It is not executed. Search, filtering, display, and Copy occur only in the browser and do not connect to a Terminal or Server.